Caterpillar Stage
Caterpillars eat a variety of substances ranging from plants to wool, and adults lay eggs on the favorite food of their particular species. Caterpillars emerge from their eggs small and wormlike. They grow by molting, and most caterpillars molt four or five times, though some undergo dozens of molts. The amount of time a moth is a caterpillar varies greatly among species but ranges from a few days to a few months.
Pupa Stage
Insects who must undergo a major transformation to become adults become pupae. Pupae often look like halfway points between the adult and the larvae. Caterpillars become pupae while in their cocoons. They begin developing wings and legs. Some caterpillar species are able to remain in their cocoons for extended periods of time if the environmental conditions aren't right, but most caterpillars remain in their cocoons for a fixed period of time regardless of environment. Environmental factors do, however, determine when a caterpillar enters the pupa stage.
Cocoon Construction
Caterpillars use tiny silk threads to spin cocoons. These threads originate from a small organ called a spinneret that is usually located near the mouth. Most begin by attaching a small pad to the underside of a tree or other object. Then they spin downward, encasing themselves in the cocoon.
Emergence
Caterpillars undergo a complete transformation into moths inside the cocoon. The scientific term for this process is holometabolism. Though butterflies often build chrysalises to survive the winter, most caterpillars use their cocoons strictly for the purposes of metamorphosis and emerge after a set period of time. Researcher Douglas Blackiston, of Georgetown University, Department of Biology, in Washington, D.C., has discovered that adult moths may actually remember their lives as caterpillars after emerging from their cocoons.