The earliest plants were descendants of marine algae, lacking roots and leaves. Around 400 million years ago, they formed an alliance with fungi, who helped them form an extended root system.
Merlin Sheldrake calls plants "fungi which have evolved to farm algae, and algae that have evolved to farm fungi."
In the Devonian period, 300 to 400 million years ago, there was a sudden reduction of carbon dioxide in the atmosphere, as much as 90 percent. Scientists thought that this might have been caused by an increase in phosphorus in the soil. But it's more likely that the biggest difference was the fungi's mycorrhizal networks, that helped improve the efficiency of the phosphorus uptake.