Fungi play a crucial role in nutrient cycling in ecosystems through processes such as decomposition, nutrient absorption, and nutrient transfer. Fungi break down organic matter, such as dead plants and animals, into simpler compounds, releasing nutrients like carbon, nitrogen, and phosphorus back into the soil. This helps to replenish essential nutrients needed by plants for growth and sustains the overall health of the ecosystem. Additionally, fungi form symbiotic relationships with plants, such as mycorrhizae, where they help plants absorb nutrients from the soil, further contributing to nutrient cycling in ecosystems.