Natural gas formation is a geological process that occurs over millions of years when organic material is subjected to high pressure and temperature deep beneath the Earth's surface. This process results in the accumulation of hydrocarbons, primarily methane, which can be extracted for energy use.