There are different characteristics in fruit that can cause them to complement savory dishes. The reason why adding a dash of citrus to savory dishes is so common is that a bit of acidity can bring out other flavors in a dish and make it taste "brighter". Some chefs also use vinegars for this.
Other fruits are used to play off of specific flavors. For instance, the sweetness of some fruits like (like pineapple or melon) can play well off of spicy or salty dishes. Hence the popularity of pineapple with ham or chiles, or melon with prosciutto.
Beyond that it can get a bit more complicated. In some cases, the characteristics of the fruit can help to play off of contrasting flavors in a dish (here is a chart), but in others there can be flavoring compounds shared between items that make them complement each other(And here is more about that.)