As you are asking how wine enhances the flavor of foods, the first thing that came to mind for me is that wine contains glutamates, which are flavor enahncers.
Most people would be surprised to know how many foods contain naturally occurring glutamates. A table on this page lists many of the foods containing glutamates along with the amounts (mg per 100g).
This article found on Wine Spectator, explains that fermentation increases the glutamate or umami levels of foods.
While many foods have natural amounts of umami, their umami levels can increase when they undergo various transformations. The most elemental of these is the ripening of fruits and vegetables. For example, a ripe tomato has 10 times the glutamate of an unripe tomato. Drying, curing, aging and fermentation all increase the umami level. Dried shiitake mushrooms and dried sardines have considerably more umami than their fresh counterparts. Why does aged beef have more flavor than unaged beef? It has more umami. Fermentation gives soy sauce, Asian fish sauces and many other condiments such as hot sauces, Worcestershire sauce, Vegemite and Bovril lots of umami.
Fermentation also applies to beverages such as beer and wine. Hanni says big, rich red wines, especially those with high ripeness levels such as Australian Shirazes, and whites that have extended lees contact such as "big, fat, ripe, creamy Chardonnays and round, delicious Champagnes" tend to have the most umami.
What many of these methods have in common is that they break down foods into smaller units of flavor, which are easier to detect. These smaller units, says Shirley Corriher, a food scientist and the author of CookWise, The Hows and Whys of Successful Cooking (William Morrow) "make taste receptors go 'ding ding' in our brain and say 'this is good.'"
So, when you cook with wine, you are adding natural flavor enhancers to your dish.
Edit in response to comment:
From a Science Direct article:
Many food ingredients, including monosodium glutamate (MSG), NaCl, and sweeteners have been termed ‘taste enhancers’ but their main effect is simply to add more molecules that generate additional taste or smell sensations. Tastants such as MSG, salt, and sweeteners don't actually boost other chemosensory properties but rather contribute additional meaty/savory, salty, or sweet properties respectively.