Two types of "simple eyes" can be found in the class Insecta: dorsal Ocelli and lateral Ocelli (=stemmata). Although both types of Ocelli are similar in structure, they are believed to have separate phylogenetic and embryological origins.
Dorsal Ocelli are commonly found in adults and in the immature stages (nymphs) of many hemimetabolous species. They are not independent visual organs and never occur in species that lack compound eyes. Whenever present, dorsal Ocelli appear as two or three small, convex swellings on the dorsal or facial regions of the head. They differ from compound eyes in having only a single corneal lens covering an array of several dozen rhabdom-like sensory rods. These simple eyes do not form an image or perceive objects in the environment, but they are sensitive to a wide range of wavelengths, react to the polarization of light, and respond quickly to changes in light intensity. No exact function has been clearly established, but many physiologists believe they act as an "iris mechanism" -- adjusting the sensitivity of the compound eyes to different levels of light intensity.
The eyes of larval and pupal forms are termed as “Stemmata” or “Lateral Ocelli”. These are very variable in structure. Lateral ocelli (stemmata) are the sole visual organs of holometabolous larvae and certain adults (e.g. Collembola, Thysanura, Siphonaptera, and Strepsiptera). In larvae of Lepidoptera, Trichoptera, Sialis, Myrmeleon they form a group, each member of which has a structure something like single ommatidium of a compound eye consisting of a cornea and crystalline lens and 7 retinal cells. The eyes of Collembola are of sane type; there are about eight on either side, each with the structure of an ommatidium of eucone type. On the other hand, in larvae of Tenthredinidae, many Coleoptera, each eye, of which there is usually only one on either side, consist of a single transparent lens-like thickening of the cuticle (the cornea) with underlying epidermis/ and below this a number of retinulae each composed of two or there innervated visual cells grouped round a rhabdom. The eyes are of this type in Pediculus. The visual cells may themselves contain pigment; or there may be pigment cells of various distributions. In some larvae the eyes are rudimentary; for example, in Ceratopogon they consist only of a pair visual cell and two overlying pigment cells.Stemmata always occur laterally on the head, and vary in number from one to six on each side. Structurally, they are similar to dorsal ocelli but often have a crystalline cone under the cornea and fewer sensory rods. Larvae use these simple eyes to sense light intensity, detect outlines of nearby objects, and even track the movements of predators or prey. Covering several Ocelli on each side of the head seems to impair form vision, so the brain must be able to construct a coarse mosaic of nearby objects from the visual fields of adjacent Ocelli.
From these considerations of structure it has been concluded that the Ocelli are adapted to the immediate perception of small changes in light intensity. But although they must be stimulated by light the insect often shows no outward response to such stimulation. Ants with their Ocelli alone uncovered behave as though blind; bees and Drosophila after blackening the compound eyes no longer show any reactions to light. In cicada Cryptotympana, on the other hand, the Ocelli as well as the compound eyes play an obvious part in light perception, and asymmetrical covering of the Ocelli leads to circus flight. In some insects, although the Ocelli by themselves are incapable of evoking reflex movements in response to flight. Drosophila and Apis the insect with Ocelli are uncovered responds more rapidly to change in the light intensity.