There are three necessary components in the generation and accumulation of oil: source rock, reservoir rock, and cap rock Source rock is a rock with high concentration of organic material that can be transformed into oil under the action of high temperature. Not every organic material can be transformed into oil, for example, wood can form only coal and methane. The remains of algae can transform into oil and, at higher temperatures, into natural gas. The most typical source rock is shale which is a fine grain rock that comes mostly from clay. Another example of source rock is limestone which is composed of calcite CaCO3, the main building element in sea shells.
The organic material in source rocks is transformed into oil at temperatures between 65°C and 150°C. These temperatures are reached at depths between about 2000 and 5500 m. Deeper into the ground the temperature is higher than 150°C. At these temperatures the oil is irreversibly converted into natural gas and graphite. The range of depths between 2000 and 5500 m is called the oil window. Only natural gas can be found below this window. Other important conditions for oil generation are pressure and time. Chemical reactions run faster at higher temperatures. At lower temperatures, or smaller depths, the oil may take millions of years to form. If a source rock has not been buried deep enough for a long period of time, the conventional oil does not form. An example is the shale oil rocks.
EarthScience WesternAustralia. (2014, September 5). Oil and Gas Formation [Video file]. Retrieved from https://www.youtube.com/watch?v=8YHsxXEVB1M