How does the mutualism of figs and wasps exactly work?
Ficus sp. (various sorts of figs); have a close relation with a sort of Wasp's reproduction.

Tiny flowers of Ficus are enclosed inside a hollow, pear-shaped concave  special-type of inflorescence, also called hypanthodium (term commonly used in flower-stage) or Syconus(term commonly used for fruit stage) when flower stage sometimes c ( from outside it looks like a single fruit but it is not).

There is a very narrow entry-hole or orifice at the apical portion of the inflorescence.

Inside the inflorescence, there are  3 types of flowers. 
1. Male flowers, 2. Female-flowers, and 3. 'Gall-flowers' those are assigned as female flowers but their 'style' is much shorter. 

Male flowers located towards the orifice, whereas female and gall-flowers locates in deeper regions.

Blastophaga, a genus of wasp, brings in required pollen,  also called gall-wasp, lay eggs inside figs.

To do that, they enter inside the fig inflorescence, lay eggs on these dwarf 'gall flowers' using ovipositor.

The eggs develop larvae, which fed on some ovules, and form pupa.  When the pupa-stage develop into mature wasps, the try to crawl-out from the orifice, they brush against the male flowers.

This pollen-laden insect when enter in another fresh fg, it also pollinate that-fig. 



Image URL : https://media1.britannica.com/eb-media/17/24017-004-98EF07A1.jpg .

Image Page-Source: https://www.britannica.com/animal/fig-wasp


  Source: College Botany, Vol-1 / Gangulee, Das, Datta; New Central Book Agency. 




P.S: I think my answer is NOT satisfactory enough

This question require more scientific details. 

Widely known fact is, fig-wasps pollinate figs. But really there is a lack of detailed information like does the mother-insect die inside the fig and only the young insect go-out? or the mother insect come out from fig after laying eggs? if the larvae eat the ovules then isn't it harmful to the fig plant at any extent? How female-figs (in dimorphic members) are pollinated... does the wasp travels from one fig to another? When the young wasp come out from the fig it certainly take some months to reach maturation to lay eggs. Within that period does the pollens sticked in their body , and viable to germinate on stigma? There are many sorts of figs. Does all of them require wasps? Would figs survive without the wasps? --- What the question seeks, is, out of the popular children-book story; the Scientific-details behind figs and wasps. I assume the answer would not broader than reasonable; if someone knows their life-cycles and structures, I think it is possible to give very point-to-point answers within limited space.