Microbes eat your waste and generate heat doing it. Everything you do to a compost pile, turning, watering, balancing browns and greens, is about keeping those microbes fed, damp and supplied with oxygen. Below: the practical detail on how composting works, and what most guides leave out.
How composting works.
The organisms doing the work
Bacteria do most of it, in shifts. Mesophilic bacteria start at ambient temperature and heat the pile as they respire. Above about 40°C they hand over to thermophilic bacteria, which drive a hot pile to 55-65°C. When the easy food runs out the pile cools and mesophiles return, joined by fungi and actinomycetes, the latter produce that earthy smell.
Then the larger organisms arrive: worms, woodlice, springtails, mites. Their presence is a sign of a maturing, healthy pile, not a problem.
Why heat happens
Heat is waste energy from microbial respiration. A pile gets hot when there are enough microbes respiring fast enough in a volume large enough to retain the heat, which is why size matters so much. Below roughly a cubic metre, heat escapes as fast as it is produced.
Why oxygen is the hinge
With oxygen, decomposition is fast and smells of earth. Without it, a different set of organisms takes over: slower, and producing the sour and rotten-egg compounds that make neighbours complain. Nearly every unpleasant compost problem is an oxygen problem wearing a disguise.
Which is why turning works. Not because mixing is magic, but because a fork full of air reaches microbes that had run out.