After the flea larva has eaten enough and grown to the appropriate size it will spin a cocoon similar to a moth. The cocoon is sticky and attracts dirt, dust and debris that adheres to it. The cocoon helps protect and camouflage the larvae as it begins its transformation.
What happens next?
Inside the cocoon the flea larva changes into a pupae. A flea pupa looks like a sarcophagus of sorts, a protective shell. Inside the pupae the larva is sort of dissolved as it is transformed into an adult flea. Forming all the adult features inside the pupae shell. When the metamorphosis is complete the pupae will split and the adult flea will emerge ready to feed.