HomeExplainers › Science

Science

How Composting Works: Turning Organic Waste Into Soil

Open Brief Staff July 6, 2026 5 min read
Key points

Leave a pile of food scraps and yard clippings alone and it will eventually rot, but rotting and composting are not quite the same thing. Rotting is decomposition happening however it happens, often producing a slimy, foul-smelling mess as the wrong organisms dominate under the wrong conditions. Composting is the same basic biological process, deliberately managed, so that the right mix of microorganisms breaks material down efficiently into a stable, nutrient-rich material that improves soil rather than a pile that just smells bad and takes a year to disappear.

What Is Actually Doing the Work

The organisms responsible for compost are mostly bacteria, with fungi and, later in the process, larger organisms like earthworms and insects playing supporting roles. Bacteria consume the organic material for energy and, in the process, break complex molecules like cellulose and proteins down into simpler compounds. As bacterial populations feed and reproduce, their collective metabolic activity generates real heat, which is why a healthy compost pile is noticeably warm to the touch even in cold weather, and why compost thermometers are a standard tool for anyone managing a pile at meaningful scale rather than a backyard bin.

Getting the Carbon-to-Nitrogen Ratio Right

Compost ingredients are usually sorted into two categories: "browns," carbon-rich material like dry leaves, cardboard, and straw, and "greens," nitrogen-rich material like food scraps, fresh grass clippings, and coffee grounds. Microorganisms need both carbon, for energy, and nitrogen, to build proteins for growth and reproduction, in a specific rough ratio, commonly cited as around 25 to 30 parts carbon to 1 part nitrogen by weight. A pile with too much nitrogen-rich green material decomposes fast but often turns anaerobic and produces a strong ammonia or sulfur smell as excess nitrogen is released as gas rather than incorporated into microbial growth. A pile with too much carbon-rich brown material decomposes very slowly because nitrogen-limited microbial populations simply cannot grow fast enough to process all the available carbon. The EPA's guidance on home composting lays out practical brown-to-green ratios for backyard bins built from common kitchen and yard waste.

Why Air and Moisture Matter as Much as Ingredients

Most of the beneficial organisms in a hot compost pile are aerobic, meaning they need oxygen to function efficiently, and a pile that is too dense or too wet excludes air from its interior, favoring slower anaerobic organisms instead and producing that characteristic rotten-egg smell of anaerobic decomposition. Turning a pile periodically, or building it with enough coarse material to leave air pockets naturally, keeps oxygen reaching the microbes doing the useful work. Moisture matters just as much: a pile that is bone dry stalls because microorganisms need water to function, while a pile that is soggy squeezes out the air pockets those same organisms need to breathe. The commonly cited target, damp like a wrung-out sponge, is a genuinely useful rule of thumb rather than an arbitrary phrase.

The Heating Phase and Why It Matters

In a well-built pile with the right mix of ingredients, air, and moisture, bacterial activity generates enough heat to push the pile's internal temperature to 130 to 160 degrees Fahrenheit within days, a range hot enough to kill most weed seeds and many plant pathogens that would otherwise survive into the finished compost and cause problems in a garden bed. This thermophilic, or heat-loving, phase can last anywhere from several days to a few weeks, after which the most readily available food sources are depleted, microbial activity slows, and the pile gradually cools. A cooling pile is not a failing one; it is simply moving into a slower maturation phase where different, more heat-sensitive organisms, including fungi and small invertebrates, continue breaking down the remaining, more resistant material.

From Active Pile to Finished Compost

Finished compost is dark, crumbly, and smells earthy rather than sour or ammonia-like, and the original ingredients should no longer be individually recognizable, aside from occasional stubborn fragments like avocado pits or corn cobs that break down slowly regardless of pile conditions. The transformation is essentially the same natural nutrient cycle that recycles fallen leaves and dead plant matter in a forest, compressed and accelerated through deliberate management, returning to soil much of what growing plants originally pulled out of it through the process of photosynthesis. Mixing finished compost into garden soil improves its structure, water retention, and nutrient content in ways that are broadly comparable, on a much smaller scale, to how engineered systems described in how water treatment works use biological processes deliberately to clean up organic waste.

The short version

Composting is decomposition managed on purpose, driven mostly by bacteria that need the right balance of carbon-rich and nitrogen-rich material, adequate air, and enough moisture to function efficiently. A properly balanced pile heats itself well above ambient temperature, killing most weed seeds and pathogens, before cooling into a slower maturation phase that finishes with dark, earthy, crumbly compost.