Compost forms as organic wastes are broken down by microorganisms in the soil. These microorganisms don't create nutrients; they just break down complex materials into simple ones that the plant can use. Most soil organisms are inactive when soil temperatures are below 40°F; they don't begin working in earnest until the temperature goes up to about 60°F, and most of them don't work well in a very acid element. Because they are extremely small, microorganisms work faster when not overwhelmed by large chunks of material.
There are two basic kinds of microorganisms: those that need air to work (aerobic) and those that don't (anaerobic). It's possible to compost in an airtight container, thanks to the microorganisms that don't need air. A tightly covered plastic trash can will convert an enormous amount of organic kitchen waste into compost in the course of a winter. The classic outdoor compost pile should be turned regularly with a pitchfork to provide air for the microorganisms that need it.