Fungi play a crucial role in nutrient cycling by breaking down organic matter such as dead plants and animals. They decompose this material, releasing nutrients like nitrogen, phosphorus, and carbon back into the soil where they can be taken up by plants. This process helps to recycle nutrients, making them available for new plant growth and contributing to the overall health and sustainability of ecosystems.