Fungal genomics studies have shown that ectomycorrhizal fungi have arisen in approximately 60 independent saprotrophic lineages. In this Review, Martin and colleagues describe the functional gains and losses that have occurred during the evolution of ectomycorrhizal symbioses.