As an adult, the lancet liver fluke—a type of flatworm—resides in the livers of grazing mammals such as cows.
Its eggs are excreted in the host's feces, which are then eaten by snails. After the eggs hatch inside the snail, the snail creates protective cysts around the parasites and coughs them up in balls of mucus.
These fluke-laden slime balls are then consumed by ants. When the flukes wiggle their way into an ant's brain, they cause the insect to climb to the tip of a blade of grass and sit motionless, where it's most likely to be eaten by a grazing mammal. That way, the liver fluke can complete its life cycle.