|Blastophaga psenes female|
Fig wasps are wasps of the superfamily Chalcidoidea which spend their larval stage inside figs. Most are pollinators but others simply feed off the plant. The non-pollinators belong to several groups within the superfamily Chalcidoidea, while the pollinators are in the family Agaonidae. While pollinating fig wasps are gall-makers, the remaining types either make their own galls or usurp the galls of other fig wasps; reports of them being parasitoids are considered dubious.
Aristotle recorded in his History of Animals that the fruits of the wild fig (the caprifig) contain psenes (fig wasps); these begin life as grubs (larvae), and the adult psen splits its "skin" (pupa) and flies out of the fig to find and enter a cultivated fig, saving it from dropping. He believed that the psen was generated spontaneously; he did not recognise that the fig was reproducing sexually and that the psen was assisting in that process.
The fig wasps are a polyphyletic group, including several unrelated lineages whose similarities are based upon their shared association with figs; efforts are underway to resolve the matter, and remove a number of constituent groups to other families, particularly the Pteromalidae and Torymidae. Thus, the number of genera in the family is in flux. The family Agaonidae has been recently updated to include all the pollinating fig wasps and the subfamily Sycophaginae. The remaining taxa such as Epichrysomallinae, Sycoecinae, Otitesellinae, and Sycoryctinae should be included in the Pteromalidae.
Among the Agaonidae, the female is a normal insect, while the males are mostly wingless. The males' only tasks are to mate with the females while still within the fig syconium (inverted flower) and to chew a hole for the females to escape from the fig interior. This is the reverse of Strepsiptera and the bagworm, where the male is a normal insect and the female never leaves the host. The non-pollinating wasps have developed impressive morphological adaptations in order to oviposit eggs inside the fig but from the outside: an extremely long ovipositor.
Most figs (>600 species) have syconium that contain three types of flowers: male, short female, and long female. Female fig wasps can reach the ovaries of short female flowers with their ovipositors, but not long female flowers. Thus, the short female flowers grow wasps and the long flowers only seeds. Contrary to popular belief, ripe figs are not full of dead wasps and the "crunchy bits" in the fruit are only seeds. The fig actually produces an enzyme called ficain (also known as ficin) which digests the dead wasps and the fig absorbs the nutrients to create the ripe fruits and seeds. Several commercial and ornamental varieties of fig are parthenocarpic and do not require pollination to produce (sterile) fruits; these varieties need not be visited by fig wasps to bear fruit.
The life cycle of the fig wasp is closely intertwined with that of the fig tree it inhabits. The wasps that inhabit a particular tree can be divided into two groups; pollinating and nonpollinating. The pollinating wasps are part of an obligate nursery pollination mutualism with the fig tree, while the non-pollinating wasps feed off the plant without benefiting it. The life cycles of the two groups, however, are very similar.
Though the lives of individual species differ, a typical pollinating fig wasp life cycle is as follows. In the beginning of the cycle, a mature female pollinator wasp enters the immature "fruit" (actually a stem-like structure known as a syconium) through a small natural opening (the ostiole) and deposits her eggs in the cavity. Forcing her way through the ostiole, she often loses her wings and most of her antennae. To facilitate her passage through the ostiole, the underside of the female's head is covered with short spines that provide purchase on the walls of the ostiole. In depositing her eggs, the female also deposits pollen she picked up from her original host fig. This pollinates some of the female flowers on the inside surface of the fig and allows them to mature. After the female wasp lays her eggs and follows through with pollination, she dies. After pollination, there are several species of non-pollinating wasps which deposit their eggs before the figs harden. These wasps act as parasites to either the fig or possibly the pollinating wasps. As the fig develops, the wasp eggs hatch and develop into larvae. After going through the pupal stage, the mature male's first act is to mate with a female. The males of many species lack wings and are unable to survive outside the fig for a sustained period of time. After mating, a male wasp begins to dig out of the fig, creating a tunnel through which the females escape.
Once out of the fig, the male wasps quickly die. The females find their way out, picking up pollen as they do. They then fly to another tree of the same species, where they deposit their eggs and allow the cycle to begin again.
The fig-wasp mutualism originated between 70 and 90 million years ago as the product of a unique evolutionary event. Since then, cocladogenesis and coadaptation on a coarse scale between wasp genera and fig sections have been demonstrated by both morphological and molecular studies. This illustrates the tendency towards coradiation of figs and wasps. Such strict cospeciation should result in identical phylogenetic trees for the two lineages  and recent work mapping fig sections onto molecular phylogenies of wasp genera and performing statistical comparisons has provided strong evidence for cospeciation at that scale.
Groups of genetically well-defined pollinator wasp species coevolve in association with groups of genetically poorly defined figs. The constant hybridization of the figs promotes the constant evolution of new pollinator wasp species. Host switching and pollinator host sharing may contribute to the incredible diversity of figs.