I thought I knew the ‘egg-> caterpillar -> butterfly-> egg’ lifecycle so when I came across this caterpillar guarding it’s eggs in my garden, I realised there was a different lifecycle going on. A quick check with a friend who volunteers at the St Andrews Botanics Butterfly house and I was researching parasitic wasps and discovering a bit of a gory tale. (I found two very informative articles here and here)
Turns out a parasitic wasp has found this large cabbage white caterpillar, laid eggs inside it using its ovipositor (looks like a big stinger, but is for egg laying). The eggs hatch and eat the caterpillar from the inside, avoiding the vital organs, to keep it alive for as long as possible.
When the larvae are ready to pupate into wasps they release chemicals that change the behaviour of the caterpillar which climbs high, as the larvae emerge the caterpillar helps make their cocoons with it’s own silk then protects the clutch of cocoons till it starves to death!
Later the wasps emerge and go to mate and seek another caterpillar to continue their ‘eggs in caterpillar-> mind control the caterpillar->emerge and pupate-> adult wasp’ lifecycle.