Fungi play a crucial role in nutrient cycling by breaking down organic matter such as dead plants and animals. They decompose these materials and release nutrients back into the soil, making them available for plants to absorb and grow. Fungi also form symbiotic relationships with plants, such as mycorrhizae, which help plants extract nutrients from the soil. Overall, fungi are essential in maintaining nutrient balance in ecosystems.