They are important decomposers, breaking down organic materials, such as dead leaves and animals, and helping the detritivores (animals that feed on decomposing material) to obtain their nutrients.
Decomposers are important in the food chain because they break down dead organisms and recycle nutrients into the soil.