After the ant dies, the fungus continues to grow inside the body. After a few days, a stroma—the fungus's fruiting body—sprouts from the back of the ant's head. After a week or two, the stroma starts raining down spores to the forest floor below. Each spore has the potential to infect another unfortunate passerby.
"The fungus accurately manipulates the infected ants into dying where the parasite prefers to be, by making the ants travel a long way during the last hours of their lives," Hughes said.
As the fungus spreads within a dead ant's body, it converts the ant's innards into sugars which are used to help the fungus grow. But it leaves the muscles controlling the mandibles intact to make sure the ant keeps its death grip on the leaf. The fungus also preserves the ant's outer shell, growing into cracks and crevices to reinforce weak spots. In doing this, the fungus fashions a protective coating that keeps microbes and other fungi out. At that point, it can safely get down to the business of claiming new victims.
The mechanisms and cues the fungus uses to control an ant's behavior remain unknown. "That is another research area we are actively pursuing right now," Hughes says. Whatever the mechanisms, this much is clear: O. unilateralis has evolved highly specialized abilities to get unsuspecting ants to do its bidding. link
Ref.: The Life of a Dead Ant: The Expression of an Adaptive Extended Phenotype. 2009. S.B. Andersen et al. The American Naturalist