Starting from the beginning; for petroleum to form, we need organic matter to be conserved and fastly buried in an anoxic environment. Kinds of rocks with high porosity (having cavities for petroleum, water or gas to be deposited inside) and high organic content (carbon compounds), such as shales, are good candidates to be that anoxic environment (source rocks) but this being said they also have very low permeability (they don’t let flow to occur). Meanwhile, this low permeability makes the rock a good host for the organic matter, and it also makes it hard for us to produce directly from the source rocks.
As the source rock gets buried withing geologic time(millions of years), the organic matter accumulated in its pores undergoes a process named maturation in which oil and gas are generated. Since pressure and temperature tend to increase with depth, the search for oil and gas is conducted in specific ranges called the oil (or gas) window. Below specific depths, organic matter is thought to be overmature, so no drilling with commercial purpose is conducted. It should be noted that to achieve economically viable amounts of high accumulation amount of organic matter needs to be acquired by processes like sudden mass death of algeas/planktons accumulating in the lake or ocean bottoms. A dinosaur dying wouldn’t help much because they aren’t thought to have large biomass communities and since a dead dinosaur would probably get consumed by another creature, it would continue to be a part of the active carbon cycle.
Due to the overburden pressure and expansion during the generation, the oil (or gas) might be able to migrate from the source rock to another rock. The migration might happen more than once until the atmospheric pressure (surface) is reached. However, sometimes the oil gets trapped in a structure called a reservoir, consisting of a trap (cap rock) and reservoir rock (generally sandstone or limestone). That’s when we get lucky (or who knows maybe not given all the climate change and pollution). In order to detect where and if there is a commercially viable accumulation of oil, exploration activities are conducted, which will be the topic of Part 2 of this series.