In all Endopterygota insects, where wings and other structures develop internally, (in invaginate imaginal epidermal pockets) such as beetles, wasps, bees, butterflies, moths etc., the larva which hatches out of egg is extremely different from the imago, in habit, appearance and structure. The larva has a worm-like body, biting and chewing mouth parts, simple eyes and weakly developed walking legs. It has quite a dissimilar habit. For instance the mosquito larva lives in water and feeds on protozoa and algae, while the adult either sucks blood or fruit and flower juices. A more general example s the butterfly larva which crawls on the ground and feed on leaves and then gets changed into an aerial organism feeding on nectar from flowers.
The larvae of these types of insects are either swimmers or crawlers, and are voracious eaters. They grow in size and moult various times till they attain a quiescent, non- feeding stage called pupa. The pupa is enclosed in a pupal case or the puparium secreted through the labial glands of the larva. This pupa does not move or feed and its energy have to come from the nutrients it ingested while a larva. Externally it appears as an inactive structure. Though internally it undergoes basically two types of changes at a rapid pace and moults just only after the complex series of internal changes have taken place. These changes include wholesale destruction of most of the larval tissues (histolysis) and the formation of a completely new adult body whose organs and systems are developed (histogenesis) from nests of organ specific cells, called the imaginal discs. Histolysis results in systematic destruction of the old body of the larva that is why all the organs except for the central nervous system are broken down by unique amoebocytic cells called phagocytes. The tissue fluid, which arises due to the destruction is used as raw material in the creation and histogenesis of the adult organs. After these changes are completed as a result of histolysis and histogenesis the pupa goes through the pupal moult and the imago (adult) emerges fully ready to lead a short or long independent existence and to reproduce.