A Cocoon is a case made of open, woven silk. Many insects spin a cocoon before they begin pupation and many spiders spin one to hold their eggs.
Cocoons may be tough or soft, opaque or translucent, solid or mesh-like, be a variety of colours and they can be composed of many layers, depending on the type of insect larva producing it.
Some larvae attach small twigs, fecal pellets or pieces of vegetation to the outside of their cocoon in an attempt to disguise it from predators. Others spin their cocoon in a concealed location - on the underside of a leaf, in a crevice, down near the base of a tree trunk, suspended from a twig or concealed in the leaf litter.
Insects that pupate in a cocoon must escape from it, and they do this either by the pupa cutting its way out, or by secreting fluids that soften the cocoon. Some cocoons are constructed with built-in lines of weakness along which they will tear easily from inside, or with exit holes that only allow a one-way passage out; such features facilitate the escape of the adult insect after it emerges from the pupal skin.