The thermal history of a sedimentary basin, where hydrocarbons and coals form, plays a crucial role in controlling the formation of economic deposits of hydrocarbons and coals. For hydrocarbon deposits, the temperature of the basin controls whether oil or gas or both forms. Oil is typically generated at lower temperatures, whereas gas is typically generated at higher temperatures. For coal deposits, the temperature of the basin controls whether high or low grade coal forms. Higher grade coal forms at higher temperatures and lower grade coal forms at lower temperatures.
However, there are a number of other very important factors that control the formation of these deposits. The type of source rock is an important factor since some source rocks are prone to generating oil, other source rocks are prone to generating gas and others are prone to generating coal. This relates to the type of kerogen in the source rock and how it changes. If hydrocarbons are generated, then a suitable reservoir rock must be in place to store the hydrocarbons. A suitable reservoir rock is one which is porous enough to store hydrocarbons and permeable enough to allow hydrocarbons to flow in and out (also important for the source rock). If a suitable reservoir rock is in place, then a suitable cap/seal rock must be in place to seal off the hydrocarbons to prevent leakage towards the Earth's surface. Cap/seal rocks are fine-grained, typically mudstone. This combination of reservoir and cap/seal rock must then be suitably structured in order to trap an economic deposit. Suitable structures include anticlines, sealing faults and unconformities. Hydrocarbons will rise via buoyant forces and be trapped towards the crest of an anticline. ALL of these factors must be in place at the right TIME for deposits to form.