If we assume our soil starts as naked rock, the pores of it and its surface will slowly become colonized by lichens and black yeasts, which are highly resistant to desiccation and radiation. Together with some cyanobacteria, green algae, mosses, and other non-photosynthetic organisms, this naked rock will soon form what is commonly known as a biofilm. All of this will slowly degrade the bedrock and accumulate organic matter, producing a true (albeit very fragile and thin) soil layer. From this you can start observing growth of smaller plants, whose roots can accelerate rock meteorization, contribute with necromass to the soil layer once they died and help cycle water. In those roots, fungi will be helping extracting minerals and water from the substrate as mycorrhizal associates, and it'll be fungi the main decomposers of dead plant debris once these plants die. As the soil layer keeps accumulating, fungal hyphae will constitute a considerable fraction of the organic matter content and will help alongside plant roots to maintain soil structure. Fungal hyphae not only allow plants to reach new resources, but bacteria and othermicrobes as well.
The way this evolution will proceed depends on the climatic conditions, the geological properties of the bedrock, the type of vegetation in that particular area and many other minor details like the shape of the terrain or the communities of invertebrates. Fungi interact with all biological components of that system as symbionts, pathogens, food source, competitors and even predators.