Oil and natural gas are formed underground, over several to tens of millions of years, from prehistoric organisms decomposed by high subterranean heat and microorganisms. Oil and gas collect in formations underground, where they are prone to accumulate, to form oil/gas fields.
Natural gas is found in rock formations deep below the surface of the Earth. Petroleum, or oil, is often found in the same areas.