Q: Why do butterflies stay in a cocoon and for how long?

— Sophie Harrison, 6, Midvale Elementary School, Madison

A: Caterpillars start out as tiny creatures. In the beginning they eat lots of food — just like the book “The Very Hungry Caterpillar” — and get bigger and bigger.

Eventually the caterpillar will be ready to transform into a butterfly or moth in a process called metamorphosis.

The caterpillar will go through the pupal phase, which is where it forms a cocoon or chrysalis. Butterflies make a chrysalis while other insects, like the tobacco hornworm caterpillar, make a cocoon and become a moth. They will stay and transform over time into a butterfly or a moth.

Most butterflies and moths stay inside of their chrysalis or cocoon for between five and 21 days. If they’re in really harsh places like deserts, some will stay in there for up to three years waiting for rain or good conditions. The environment needs to be ideal for them to come out, feed on plants and lay eggs.

The beautiful sphinx moths that come from the tobacco hornworm caterpillar will live for a couple of weeks to a month, depending on how good the conditions are. When they come out, they find a mate, lay eggs and start the whole cycle over again.

Jeremy Hemberger is a graduate student with the department of entomology at the University of Wisconsin-Madison and a volunteer with the campus Insect Ambassadors organization.