Escape from pupa . Pupa splits along a line of weaknesss, due to the insect pumping fluid from the abdomen into the throax and head. Sometimes have specialized pumping structures like flies. Many insects have teeth, ridges on the head or other structures to help tear open pupa or cocoon. Many insects which do not feed as adults have mandibles anyways, just so they can get out of the pupa.
Some insect produce softening secretions just before emergence to break down the cocoon.