Decomposers play a crucial role in recycling nutrients in ecosystems by breaking down dead organic matter (such as leaves, animal waste, and dead organisms) into simpler compounds. This process releases nutrients back into the soil, making them available for other organisms to use, thus ensuring the continuation of nutrient cycling in the ecosystem.