Natural gas is formed from the remains of ancient plants and animals. Over millions of years, organic matter buried underground is compressed and heated by deep sediments, transforming it into fossil fuels like oil and natural gas. This process, called thermogenic methane formation, breaks carbon bonds and produces more natural gas at higher temperatures over 1-2 miles below the surface. Alternative biogenic methane formation occurs near the surface as microbes break down organic matter, though this gas often escapes unless trapped underground.