Composting is the process by which living organisms break down organic waste, turning it into into humus, a soil-like substance rich in nutrients plants need to grow. All creatures play a role, but gardeners are mainly concerned with the activities of those organisms at work in their compost piles: macroscopic creatures such as worms, flies and beetles, and micro-organisms such as bacteria, fungi, algae and actinomycetes.
Different waste-processing organisms create different output, some more useful in the garden than others. These organisms and the composting they do are broadly categorized as either aerobic (requiring oxygen) or anaerobic (disliking oxygen). Aerobic composting is the preferred: It is more efficient, quicker and less smelly than anaerobic composting.
Aerobes occur in the soil at a density of about 10 million organisms in a single gram of soil. Their abundance is one key to the efficiency of aerobic composting. Another is their voracity; almost any organic waste will suffice as a food source.
Eating nitrogen helps aerobes build the proteins they need to grow and reproduce. But in order to continue eating, aerobes rely on oxidization, which requires a constant supply of carbon and oxygen. Thus the ideal recipe for aerobic composting is 3 parts carbon-rich "brown stuff" (like leaves, straw, shredded paper and sawdust) and 1 part nitrogen-rich "green stuff" (such as kitchen scraps and manure).
Oxidization produces a great deal of heat, up to 160 degrees Fahrenheit, which speeds up the composting process considerably. It kills diseases and weed seeds and prevents cockroaches and flies from breeding. The composting process survives this heat because some types of aerobic bacteria thrive in this temperature range.
Aerobic bacteria need a moist, well-drained environment with good air distribution, which you can best achieve by turning the compost every few days and watering lightly. If the compost gets too wet, add more "brown stuff" to soak up the excess moisture.
If areas of a compost pile lack oxygen, perhaps because you haven't been turning the pile regularly or have allowed it to flood, anaerobic microorganisms will soon be the only composting agents at work. These microbes digest "green stuff" and emit a catalog of chemical wastes. Many of these have a noxious odor: acids, amines (ammonia-like chemicals), hydrogen sulfide, cadaverine and putrescine. Some of this output contains nitrogen, but not in a form that plants can absorb. Some by-products can even have a toxic effect on plants.
Because anaerobes do not function via oxidization, they produce no heat. This means a much slower composting process (by as much as 90%) than aerobic composting. It also means that pathogens and pests will continue to breed longer.
Anaerobic bacteria prefer mostly "green stuff;" kitchen scraps and fresh grass clippings are ideal. "Brown stuff" will slow down or halt the process. A high moisture concentration, such as a heavy rain on a compost pile that cannot drain well, will create an oxygen-poor environment that anaerobes love.