Special chemicals called additives are added to the base oil by the oil companies. Different combinations of these additives allow the oil to do different jobs in an engine.
Extreme-pressure additives coat parts with a protective layer so that the oil resists being forced out under heavy load.
Oxidation-inhibitors stop very hot oil combining with oxygen in air to produce a sticky material like tar, which clogs galleries.
Corrosion-inhibitors help stop acids forming that cause corrosion, especially of bearing surfaces.
Anti-foaming agents reduce the effect of oil churning in the crankcase and minimize foaming.
Detergents reduce carbon deposits on parts like piston rings and valves.
Dispersants collect particles that can block the system, separate them from each other and keep them moving. Then they will be removed when the oil is changed.