Gas and oil are held in porous rocks, like sandstone, under a cap of impermeable rock. The discovery and production of natural gas is similar in many ways to that of oil. Gas is often found mixed in with oil, or floating on top of underground reservoirs of oil. Seismic methods are used to find rock formations most likely to contain oil and gas. Drills are dug and the gas and oil are extracted.
Gas provides much of the natural pressure that drives oil to the surface.
In the past, gas was not considered a useful product, and transportation pipelines were not adequate to pipe it to markets. As a result, gas was simply burned off at the well, in huge flares. How much was lost is unknown. Also unknown is how much gas remains in the ground. Natural gas reserves are dwarfed by coal reserves in the US, but are still expected to be able to supply the nation for 60 years or more.