Oil comes from the remains of tiny marine organisms, mainly algae and plankton, that lived in ancient oceans millions of years ago. Through a slow process of burial, heat, and pressure, this organic material transformed into the crude oil we extract today. Most of the world’s current oil reserves formed during the Mesozoic Era, between 252 and 66 million years ago, when warm, shallow seas covered much of the planet.
The Living Starting Material
The story of oil begins not underground but in sunlit water. Algae, plankton, and other microscopic organisms flourished in ancient shallow seas, absorbing sunlight and storing energy in their cells as carbon-rich organic compounds. When these organisms died, most of their remains were consumed by bacteria or broken down by oxygen in the water. But under the right conditions, a fraction of that organic material sank to the seafloor and was preserved.
The key condition was low oxygen. In certain marine environments, oxygen levels near the seafloor dropped low enough that decomposition slowed dramatically. Research in the Black Sea has shown that roughly 50% more organic matter is preserved in seafloor sediments exposed to low-oxygen conditions compared to well-oxygenated waters. Without burrowing animals to churn the sediment and without efficient bacterial breakdown, dead organisms accumulated in layers of organic-rich mud.
Burial and the Birth of Kerogen
Over millions of years, rivers carried sand, silt, and clay into these seas, burying the organic-rich layers under thickening piles of sediment. Each new layer added weight, compressing everything beneath it. The organic mud hardened into dark, carbon-rich rock known as source rock.
Inside that source rock, the organic material began to change. Rising temperature and pressure slowly rearranged its molecular structure, converting it into a waxy, solid substance called kerogen. Kerogen is not yet oil. Think of it as a halfway point, a concentrated form of ancient biological energy locked inside the rock. The type of kerogen that forms depends on the original mix of organisms. Algae-heavy deposits tend to produce kerogen that later yields oil, while plant-heavy material leans toward natural gas.
The Oil Window
Kerogen only transforms into liquid oil when it reaches a specific range of temperature and depth, commonly called the “oil window.” This window sits between roughly 60°C and 120°C, which typically corresponds to depths of about 2 to 4 kilometers below the surface (roughly 4,000 to 8,000 feet, depending on local geology). At these temperatures, the long, complex molecules in kerogen crack apart into shorter hydrocarbon chains, producing crude oil.
If burial continues and temperatures climb past 120°C, those hydrocarbon molecules break down further into even simpler compounds, primarily natural gas. This deeper, hotter zone, between about 120°C and 200°C at depths of 4 to 6 kilometers, is called the gas window. Push organic material deeper still and temperatures destroy the hydrocarbons entirely, leaving behind graphite. The oil window is a relatively narrow sweet spot, which is one reason oil deposits are found in specific geological settings rather than everywhere underground.
What Crude Oil Actually Contains
The liquid that results from this process is a complex mixture. Crude oil is composed largely of hydrocarbons, molecules built entirely from hydrogen and carbon atoms arranged in hundreds of different configurations. But it also contains smaller amounts of sulfur, nitrogen, and oxygen, along with trace metals like nickel, vanadium, and iron. The exact recipe varies from field to field because it reflects the unique blend of organisms and conditions from millions of years ago. Light, low-sulfur crudes formed from different starting material and thermal histories than heavy, sulfur-rich ones.
How Oil Moves and Gets Trapped
Oil doesn’t stay in the source rock where it forms. Because it’s lighter than the surrounding water-saturated rock, it migrates upward through porous layers, squeezing through tiny spaces between sand grains or along fractures in the rock. Left unchecked, it would eventually seep all the way to the surface, which is exactly what happens at natural oil seeps around the world.
For oil to accumulate in a reservoir large enough to drill, three geological ingredients need to line up. First, there must be porous reservoir rock, typically sandstone or limestone, with enough tiny spaces to hold large volumes of fluid. Second, an impermeable cap rock, often shale or salt, must sit above the reservoir to block upward migration. Third, the rock layers need to form a trap: a geometric shape that funnels and holds the oil in place.
Traps come in two broad categories. Structural traps form when rock layers are bent or broken by geological forces. The most common is an anticline trap, where layers fold into an arch and oil collects at the peak beneath the cap rock. Fault traps form when movement along a crack in the Earth displaces rock layers, placing impermeable rock against the reservoir and blocking the oil’s path. Salt dome traps occur when underground salt, which is less dense than surrounding rock, pushes upward over time, deforming nearby layers and creating pockets where oil pools against the salt.
Stratigraphic traps are different. They result from the way sediment was originally deposited rather than from later deformation. If a layer of porous sandstone pinches out or is surrounded by impermeable shale, oil can become trapped without any folding or faulting. These traps are harder to find because they don’t show obvious structural features on surveys.
Where the Biggest Reserves Ended Up
The geography of oil reserves today reflects where these conditions, organic-rich source rock, the right burial depth, and effective traps, all came together millions of years ago. The Middle East holds enormous reserves partly because the ancient Tethys Sea deposited vast quantities of organic material that was later buried to ideal depths beneath effective cap rock. The U.S. Geological Survey has assessed undiscovered conventional resources across more than 170 geological basins worldwide, from the Santos and Campos basins off Brazil’s coast (estimated at 10.4 billion barrels of undiscovered oil) to basins across Mexico, Central America, and the Arabian Peninsula.
Not every ancient sea produced oil. The process required the right organisms dying in the right low-oxygen environment, being buried to the right depth at the right speed, and having somewhere to accumulate. Miss any one of those steps and no recoverable oil forms. That chain of geological coincidences is why oil is found in specific regions rather than evenly distributed across the planet.
The Abiogenic Alternative
A minority scientific theory proposes that some hydrocarbons aren’t biological in origin at all but instead formed from primordial carbon deep within the Earth and migrated upward into the crust. Proponents point to methane found on other planets and moons, where no life exists, as evidence that hydrocarbons can form without biology. However, the overwhelming scientific consensus supports the biological origin of petroleum. The chemical fingerprints in crude oil, including specific molecular structures called biomarkers that can only come from living organisms, consistently point back to ancient marine life as the source material.

