Generally caterpillars live in cocoons and become pupae, and then metamorphosize into butterflies or moths. As far as I can recall, I'm pretty sure caterpillars are the only animals to do so.
Butterflies start as caterpillars, or larvae, eat voraciously, then attach to a branch or a leaf, and spin a cocoon, also called a chrysallis. They emerge as butterflies or moths.
Cocoons come from a caterpillar,earthworms who are not inscets also lay their eggs in cocoons. Silk Worms are another animal that lives in a cocoon. Finally, the last animal that lives in a cocoon is a butterfly. The average length that a cocoons has to develop is 9 to 15 days.