Why would putting organic waste in one place (a landfill) make it produce a different gas than putting it somewhere else (a compost pile)?
The key is oxygen. In landfills, there’s so much garbage that nearly all oxygen is pressed out under the weight of it. A bag of household garbage doesn’t seem like enough to eliminate oxygen, but when the garbage of an entire city is put together, it becomes so heavy that it creates an environment where oxygen can’t exist. Thus, organic materials in landfills don’t decompose as they naturally would, say if you tossed an apple core into the woods — or into a compost pile! Compost is turned regularly, allowing oxygen to permeate materials as it would naturally.
When organic materials break down without oxygen (anaerobically) in a landfill, the byproduct is methane, a greenhouse gas that is much more potent than CO2. Even though there’s a about 5X less methane than CO2 in the atmosphere, the methane that is there still has a 4X higher global warming effect over a 100-year period!