Not all crude oil has the same composition. Some is heavier, some lighter, and some sour, meaning it contains more than about 2.5 percent sulfur. All crude oil, though, is a mixture of different hydrocarbons, which are molecules composed of hydrogen and carbon. These two elements may be hooked together many ways, in long chains, large branched molecules, or molecules assembled around rings of carbon.
Oils from different regions have a different balance of hydrocarbons, largely depending on whether some of the lighter components of the oil have been able to escape. Some oils contain lots of hydrogen sulfide, which complicates processing and pollution prevention, and all contain trace elements they have picked up during centuries sealed in rock. Crude oils also must be separated from water and salt they contain.
Hydrocarbons form from the decomposition of organic matter (according to almost all experts). Most are volatile. That is, they tend to rise, to escape. When a layer of rock containing crude oil is trapped under an impervious layer, the oil's volatile components cannot easily escape. If the oil-bearing rock and the layer above it are wrinkled by geologic action, the oil may gather inside an upward fold, with lighter hydrocarbon gases atop it. A dome or long field of crude oil can then be harvested with wells that drill through the cap rock.
Other places oil may accumulate underground include pinch outs, slanted wedges of permeable rock between two impermeable layers, and salt domes, where a plug of salt has moved upward, dragging up permeable layers to concentrate pools of crude oil.
Energy production is crucial to industrial society, and the components of crude oil are useful in many other ways as well. Therefore, most people know the names of many specific forms of hydrocarbon, like methane, butane, and kerosene.
There are different ways of categorizing the hydrocarbon components of crude oil though. One way is by the forms the molecules take. Hydrocarbons can be fully saturated or unsaturated. Saturated hydrocarbons are using all the available hydrogen bonds. They are called alkanes.
Unsaturated hydrocarbons still have hydrogen bonds available and can form polymers, plastics and synthetic rubbers. These are alkenes.
Other hydrocarbons, the aromatics, are built around rings of carbon molecules. Refineries can alter the shapes of hydrocarbon molecules to match specific uses, creating aromatics, for example.
Another way of categorizing hydrocarbons is according to their fraction. Crude oil is separated into fractions in a distilling tower. The oil is heated to boiling at the bottom of the tower, which has levels constructed to condense the fractions of oil vapor at levels that correspond to their different boiling points and molecule size.
The lightest fractions, the gases, are piped out of the tower at the top. They will be separated further, and some parts, mostly methane, sold as LNG, liquefied natural gas. The next lightest fraction is the naphthas. They will go into gasoline or be used to make chemicals. The next, kerosene, will make aviation fuel. Still heavier oils, called light gas oils, will mostly become diesel.
Heavy gas oils, the next fraction, are not very useful as they are. Most will go to a catalytic cracker, where they are broken-cracked-into smaller, lighter molecules, naphthas, which can be used in gasoline or chemicals. Lubricants are still heavier. They too are sometimes cracked into naphthas. Fuel oil is very heavy, and powers ships, among other uses. Heaviest of all is asphalt, which is mixed with aggregate and spread on roads. An animation of the distilling process is here, at Info Bank. The site features copious explanations of many aspects of the energy industry. It's directed at schoolchildren, but instructive to any interested layperson.
The smallest lightest hydrocarbon molecules have lower boiling points and smaller molecules, and are more volatile. They give off the most energy. Different crude oils tend to produce different ratios of specific hydrocarbons, with different impurities. Refineries can handle any mixture, and tune their processes to produce more or less of a different fraction according to demand.
Hydrocarbons store energy. Industrial society has learned to release this energy in controlled ways. Though our hydrocarbon use has brought many problems with it, from habitat destruction to global warming, it is hard to see how the lives we lead would be possible without crude oil.