Tapeworms are large, flat worms that live in the intestines of humans and other animals and can achieve lengths of up to 30 feet. Sections of the worm (proglottids) which contain eggs are excreted by the initial host, and if the faeces are left untreated, the eggs may be ingested by intermediate hosts, such as pigs and cattle. The eggs hatch in the intermediate host, and the larvae attach themselves to the intestinal wall, eventually passing through into the bloodstream, and invading muscle and fatty tissues, where they form cysts. When the animal is killed for food, humans ingest the parasite by eating these cysts in raw or undercooked meat or fish. Once inside the intestinal tract, the cysts hatch, developing into adult worms, which then attach themselves to the new host's intestinal wall. The worms then grow in length, until they are adults and ready to reproduce, at which point the cycle is complete.
A fuller account can be found at: http://www.merck.com/mmhe/sec17/ch196/ch196k.html