Fungi play a crucial role in nutrient cycling in forests through the process of decomposition. They break down organic matter, such as dead plants and animals, into simpler compounds, releasing nutrients like nitrogen, phosphorus, and carbon back into the soil. This enables these nutrients to be recycled and reused by plants, promoting the overall health and diversity of forest ecosystems.