Wa'alaikum as'salaam,
Petroleum is a by product plants and dead organisms that are buried deeper and deeper into the earth over thousands of years ago. The heat, pressure of all the rock above it and long time transforms them into petroleum.
When tiny organisms die, they sink to the bottom of the sea and are mixed with mud and silt. Over time, hundreds of feet of mud containing the organisms accumulate. Bacteria removes most of the oxygen, nitrogen, phosphorus, and sulfur, leaving mainly hydrogen and carbon. Lack of oxygen keeps the animals and plants from decaying completely. The partially decomposed organisms create a slimy mass, which is then covered with layers of sediments. Over millions of years, many layers of sediment pile on top of the once-living organisms. The weight of the sediment compresses the mud into a fraction of its original thickness. When the depth of burial reaches about 10,000 feet, heat, time and pressure turn the organisms into different types of petroleum.
Higher temperatures usually produce lighter petroleum. Lower temperatures create a thick material, like asphalt. As the heat continues to alter the substances, gas is often produced. Depending on how much gas is present, sometimes it will stay mixed with the oil and sometimes it will separate. At temperatures above 500 degrees Fahrenheit, the organic matter is destroyed and neither oil nor gas is formed.
The mud and silt become more and more compressed and turn into a rock known as shale. As the mud is being compressed into shale, the oil, gas and saltwater are squeezed out. The fluids move from the original rock, known as the source rock, to a new rock, called a reservoir rock.
Article Source:
http://EzineArticles.com/786475