Figs are not technically a fruit, they are actually more like an inverted flower. These are known as a syconium where flowers and seeds are borne. Due to the fact that the flower is inverted, most pollinating insects cannot get to the pollen. Without pollination the fig tree wouldn’t be able to reproduce.
This is where the fig wasp comes into play. The fig tree and the fig wasp (Blastophaga psenes) have evolved a mutual relationship. The fig tree can only be pollinated with the help of the fig wasp and the fig wasp can only reproduce inside a fig syconium.