The caterpillar turns to mush. Its nervous system seamlessly morphs into a new one. Many neurons are retained, some are pruned, and some new ones are formed.
This is why certain memories can be retained and certain ones can't.
This is why certain memories can be retained and certain ones can't.
EDIT:
"Textbooks will commonly talk about the insect dissolving into a kind of “soup”, but that’s not entirely accurate. Some organs stay intact. Others, like muscles, break down into clumps of cells that can be re-used, like a Lego sculpture decomposing into bricks. And some cells create imaginal discs—structures that produce adult body parts. There’s a pair for the antennae, a pair for the eyes, one for each leg and wing, and so on. So if the pupa contains a soup, it’s an organised broth full of chunky bits."
https://www.nationalgeographic.com/science/article/3-d-scans...