Nearly all species in the class are terrestrial (although a few are aquatic). They mostly function as decayers, especially of wood. However, some species are pathogenic or parasitic, and yet others are symbiotic. These include the important ectomycorrhizal symbionts of forest trees.