Most of the energy in grass is locked up in cellulose and other complex recalcitrant molecular compounds like lignin and waxes. Stomach acid alone cannot degrade these compounds into components that yield energy for the animals that eat grass. When faced with how to survive off an abundant, yet inaccessible food source, grazers turned to microbes that have been degrading compounds like these for millions of years.
The digestive system of herbivores is a soup of microbes. Archaea, bacteria, fungi, protozoans... they're all in there. Most for a good reason.
A paper from a couple of years ago sheds a little light on the mutualisms between grazers and fungi.
The paper sequenced fungi in the fecal matter of bison, cattle, pronghorn, and prairie dogs at either Sevilleta (New Mexico) or Wind Cave (Wyoming).
A few interesting points.
First, half of the sequences they identified in bison and cattle were from Neocallimastigales. These are anaerobic fungi that produce the compounds responsible for hydrolysing cellulose and hemicellulose. We rarely ever hear about them, but they are the analog to brown-rot fungi that are important for wood decay.
Second, it appears that some of the fungi found in the fecals could only have gotten there from the animals ingesting roots. Some of these coprophilous fungi become endophytes, especially in roots. Bison and cattle occasionally eat roots of grasses. Prairie dogs a lot more.
Third, pronghorn fungal communities are just different (and less diverse). Pronghorn are browsers and just wouldn't have the same need for degradation as grazers.
Herrera, J., R. Poudel, and H. H. Khidir. 2011. Molecular characterization of coprophilous fungal communities reveals sequences related to root-associated fungal endophytes. Microbial Ecology 61:239-244.
Davis, O. K. and D. S. Shafer. 2006. Sporormiella fungal spores, a palynological means of detecting herbivore density. Palaeogeography, Palaeoclimatology, Palaeoecology 237:40-50.