A cocoon is a protective covering for a pupa spun out of silk secreted by many caterpillars and moths. Depending on the type of insect, the cocoon can be soft or hard, translucent or opaque and of various colours. The pupae that lie inside the cocoon either cut their way out or secrete some enzymes that soften the cocoon thus helping the insect come out of the cocoon as an adult.