The worm or insect need to eat the spores they have to be alive… they then when it comes the right time start to spawn… these fungi have been inspiration for many horror movies and stories… some say HR Geiger Alien is one of them.
Check out zombie ants… not a film, it’s a true story… not exactly like cordyceps militaris but similar…
Fungi are the most amazing things… the single largest living organism on earth. Armillaria in Oregon check that out too