To form oil and gas, you need an organic rich layer of sedimentary rock known as a hydrocarbon source rock. But to create a reservoir of oil and gas so large that a company will risk a lot of time, effort, and money, trying to drill it, well for that you need a whole hydrocarbon system. A hydrocarbon system consists of two to six elements depending on what type of oil or gas resource you're searching for. You've probably already recognized that in either case the source rock must be one of these. The source rock in this figure is this purple layer that you see. Without it, there's no oil or gas, even if you have all the other system elements. The second element is thermal maturation. As the source rock is buried deeper and deeper below the earth's surface, its temperature rises. This heating breaks down and cracks the organic matter in the source rock, releasing hydrocarbons. Natural gas formation starts in the source rock all the way up at the surface. Which is why natural gas can be collected at landfills. Oil formation however, does not begin until the source rock is buried to a deep enough depth that the temperatures rise to 60 degrees Celsius, or 140 degrees Fahrenheit. This depth is typically at about two kilometers. Furthermore, oil formation stops at around 160 degrees Celsius, or 320 degrees Fahrenheit, which corresponds to a depth of about five kilometers. This temperature depth range for oil formation is known as the oil window. Below it, only natural gas forms as the higher heat at these depths not only cracks the remaining organic matter in the source rock, but also any oil remaining in the rock which is broken down into shorter and lighter and less gaseous chains of hydrocarbons. In fact, it is at these greater depths and temperatures below the oil window that natural gas formation from the source rock is maximized. Note that the release of oil and gas from the organic matter in source rock is a slow process. Therefore, the amount of oil and, or gas the source rock produces is not only a function of how deep it's buried, but also the amount of time it spends in a particular depth or temperature range. For a source rock to release the maximum amount of oil, it must move into the oil window and stay there long enough for not only all the oil that it can yield to be produced, but also for that oil to escape. If a source rock remains above the oil window, its organic matter will largely remain intact and give up relatively little gas and no oil. And if the source rock is moved into and out of the oil window, say due to tectonic folding of the strata as shown here, oil production will turn on and off. Gas production will also rise and fall as the source rock moves below and back into or above the oil window. At this point in the hydrocarbon system, you have all the elements that you need for shale gas and shale oil. That's because the source rock, not only produces these hydrocarbons, the rock also serves as their reservoir. A source rock is difficult to get oil and gas out of, however. Furthermore, you have to drill a lot of a source rock to get enough oil and gas out of it to cover your cost of drilling. It is only over the past couple of decades that the cost of getting oil and gas out of a source rock has come down enough to make the process economic. Prior to that, you needed additional elements in the hydrocarbon system, one of which was a good reservoir rock, which is shown as this multicolored layer here. In fact, a lot of oil and gas exploration today still focuses on finding oil and gas in a reservoir rock that is different from, and separated from, the source rock. A good reservoir rock acts link a sponge, holding a lot of oil and gas in a limited area. It also gives up that oil and gas with a lot less effort than is required to get it from the source rock, however even the best reservoir rock will only fill with oil and or gas if there is a pathway connecting the source rock and the reservoir rock. At this point, I need to remind you that oil is lighter than water, and gas is light than oil. This is important because spaces in rocks below the earth's surface are filled with water. So, as oil and gas are cracked out of the source rock, they're buoyancy drives them up through the water filled spaces in the overlying rock towards the surface. A good migration pathway will preferentially direct much of that migration right into the reservoir rock. The final fifth and sixth elements in hydrocarbon system combine to keep the hydrocarbons from reaching the surface. One of these is cap rock, which is this gray layer that you see here. As the name implies, it's a rock that overlies the reservoir rock and is resistant to oil and gas penetration. The other element is a trap, which in this particular figure is the bowing or fold of strata that you see. Other types of traps include changes in rock type along a reservoir, such as can be caused when the reservoir is fractured and vertically displaced, such as shown in this part of the figure here. Together, a cap and a trap prevent vertical and lateral escape of the oil and gas and thus create a geologic dead end where the incoming oil and gas is forced to accumulate. So there you have it, the major elements of a hydrocarbon system. A source rock, thermal maturation, a migration path way, a reservoir rock, a cap rock and a geologic trap. Should be pretty clear that the coexistence and linkage of all these elements at any one time on earth is relatively rare. However, over geologic time, hydrocarbon systems have formed again and again, not only creating the voluminous accumulations of oil and gas that we've extracted thus far, but also many additional reserves that we have yet to tap.