What is oil?

Crude oil, commonly known as petroleum, or simply just oil, is a mixture of hydrocarbon compounds.

Essentially, oil is the remains of prehistoric plants and animals that is buried under sediments in lakes, swamps, and oceans. The sediments eventually turn into rocks. Over the millions of years since then, the remains were exposed to heat and pressure, forming what we know of as crude oil.

The mud layer turns into rock layer and dead animal and plant layer turns into crude oil
Formation of crude oil from dead animals and plant layer. (http://www.bbc.co.uk/bitesize/standard/chemistry/materialsfromoil/how_crude_oil_was_formed/revision/2)