Sedimentary Rock
Sedimentary rock plays a large role in the primary stages of fossil fuel formation. Fossil fuels are formed from the decay of plants and animals that lived millions of years ago. Their remains were buried under layers and layers of silt and ocean sediment that would eventually harden and turn into sedimentary rock. This layering of rocks creates pressure and is one of the first steps in the formation of fossil fuels such as coal, oil and natural gas.
Porous Rock
Porous rocks play a part in the end stages of fossil fuel formation, particularly for the formation of oil and natural gas. Porous rocks, like the name suggests, are rocks that have lots of pores on their surface just like a sponge. Because of the great pressure caused by overlaying layers of rock, the oil and gas are eventually forced upward through the pores in the rock.
Nonporous Rock
Nonporous rocks do not have any holes in their surface and oil and gas cannot pass through them. Nonporous rocks are crucial to the final stages where oil and natural gas collect because they provide a nonpenetrable barrier for the fossil fuels. Since the fuel has nowhere else to go, it collects beneath the nonporous rock. This is why nonporous rocks are sometimes referred to as "cap-rocks."