As nutrients are not always plentiful many trees form symbiotic relationships with bacteria, for example nitrogen fixing bacteria in root nodules. Some trees can also specially cultivate microbes, essentially farming them, to provide the correct nutrient balance that they need for growth. This is especially found in more acidic-soiled forests, where there are fewer nutrients in the soil. The levels of different bacteria are controlled by way of secretions from the roots.
As trees are quite big, and have roots stretching out to long distances, their impact clearly has a large effect on the surrounding microbiome (the set of microbes in the soil) and the general ecosphere. Bacteria that can precipitate minerals in useable form from the soil are encouraged, while those that do not are discouraged from growth. Experimentally, it's also been shown that by changing the levels of bacteria in the soil you can change the health of the surrounding trees so my bacterially-inclined mind is starting to think that this might not just be a one way connection. There's clearly a lot of communication going on in the soil; between different bacterial species, between fungi and bacteria, and between the tree-roots and almost all surrounding life (trees are well known for forming large networks with fungi).
The mechanisms by which trees select the ideal bacterial species have not yet been determined, but I'm tempted to believe that small molecule signals will be involved. That's mostly how bacteria communicate with each other, and it's possible that trees could have hijacked and used this system to communicate with the bacteria themselves.
Calvaruso C, Turpault MP, Leclerc E, Ranger J, Garbaye J, Uroz S, & Frey-Klett P (2010). Influence of forest trees on the distribution of mineral weathering-associated bacterial communities of the Scleroderma citrinum mycorrhizosphere. Applied and environmental microbiology, 76 (14), 4780-7 PMID: 20511429