When the caterpillar has grown enough, it stops eating and forms a chrysalis hanging from a twig or buried in the soil. Inside, its body is completely rebuilt until it emerges as a butterfly. The same happens in beetles, flies and wasps, where it is usually called a pupa.
When rearing mealworms or black soldier fly larvae, the prepupa is the mature larva that stops eating and looks for a dry place to transform.

