Natural gas is predominantly composed of methane, a simple hydrocarbon compound consisting of one carbon atom and four hydrogen atoms. It is formed deep beneath the Earth's surface through the decomposition of organic matter over millions of years. The gas is then extracted from underground reservoirs through drilling and hydraulic fracturing, also known as fracking.