Fungi play a crucial role in ecosystems as decomposers, breaking down organic matter like dead plants and animals. This process helps recycle nutrients back into the soil, making them available for other organisms to use. Additionally, fungi form mutualistic relationships with plants, such as mycorrhizae, where they help plants absorb water and nutrients from the soil in exchange for carbohydrates produced by the plants. Fungi also interact with other organisms as pathogens, causing diseases in plants and animals. Overall, fungi have diverse interactions with various organisms in ecosystems, contributing to the balance and functioning of the ecosystem.