Eating undercooked meat from infected animals is the main cause of tapeworm infection in people.