Fungi play a crucial role in decomposition by breaking down organic matter like dead plants and animals. They secrete enzymes that help them break down complex molecules into simpler forms, which can then be absorbed by the fungi as nutrients. This process helps to recycle nutrients in ecosystems and contributes to the breakdown of organic material, ultimately enriching the soil.