The lifecycle of tapeworms involves multiple hosts, starting with eggs being excreted by the definitive host and ingested by an intermediate host, where they develop into larvae. These larvae then infect the definitive host when it consumes the intermediate host, maturing into adult tapeworms that reproduce and continue the cycle.