It provides nutrients and a healthy soil for plants. They eat grass and leaves and kitchen scraps and virtually any other organic material and convert these into humus by a process known as biodegradation . Composting is a process that microbes have been doing for billions of years, long before humans began gathering leaves into piles. Forest floors are major composting centers every fall when the leaves pile up. This is the resting stage of a bacterium that lives in hot compost.
Some compost piles are hot, and others are cool.
Both hot piles and cool piles will create compost. However, hot compost piles degrade material more quickly than cool piles. Compost piles heat up for the same reason that you heat up when you do lots of exercise. Your metabolism speeds up. When they use lots of fuel, heat is given off as a by product.