After a butterfly has hatched from it's egg, and eaten a lot of food as a larvae (or caterpillar) it goes off to find a place to hang out.
Caterpillars usually find the bottom of a leaf, and attach themselves to it with some silk.
After that they shed their outer skin, and underneath is a hard skin that becomes the shell they stay in for a while.
When they are in this shell they are called a pupa or sometimes a chrysalis.
They stay inside the chrysalis and start growing their wings so they can turn into a butterfly.

(from: wikipedia - butterfly)
Kid Facts - Blast from the past: Hippo Sunscreen