One day, the caterpillar stops eating, hangs upside down from a twig or leaf and spins itself a silky cocoon or molts into a shiny chrysalis. Within its protective casing, the caterpillar radically transforms its body, eventually emerging as a butterfly or moth.