A fig is not a fruit in the ordinary sense. It is a hollow garden of tiny flowers, with the blooms on the inside and a small opening at the tip. A female wasp, often no bigger than a gnat, crawls through that opening. She pollinates some of the flowers with pollen she carried from the fig where she was born, and she lays eggs in others.
Daniel Janzen's 1979 essay is still the clearest map of the bargain. In most cases one fig species has its own wasp species. The larvae eat some of the seeds. The next generation of females leaves carrying pollen. A few figs have dropped the wasp and set seed without it. The famous partnership is the rule, not a law without exceptions.