ELI5: Why do certain countries have ridiculous amount of hydrocarbons(oil and natural gas) and the countries right next to them have virtually none?

The distribution of hydrocarbons (oil and natural gas) across different countries is primarily determined by geological factors. Hydrocarbons are formed over millions of years by the decomposition of organic matter under specific geological conditions, such as high temperature and pressure.
Therefore, countries that have large reserves of hydrocarbons are typically those that have been geologically blessed with the right combination of geological features and processes that lead to the formation and accumulation of hydrocarbons.
The proximity of a country to a region with large hydrocarbon reserves does not necessarily mean that it will also have large hydrocarbon reserves. This is because the geological processes that lead to the formation and accumulation of hydrocarbons are complex and dependent on a range of factors, such as the type and quality of organic matter, the depth and temperature of the rock formations, the presence of permeable rock formations, and the movement of tectonic plates.
Therefore, neighboring countries may have vastly different geological histories, which can result in vastly different amounts of hydrocarbons. Additionally, geopolitical factors, such as the ability to extract and develop hydrocarbons, can also play a role in determining a country's level of hydrocarbon reserves.

/r/explainlikeimfive Thread