Certain pieces of the engine sit close together. Running oil between these parts provides lubrication, preventing the metal from touching. Additionally, the oil carries any heat away from the parts.
To make all of this happen, oil can have many different types of additives:
Detergent. Suspends any dirt, cleaning impurities in the oil that could cause a deposit in the engine.
Corrosion/Rust inhibitors. Prevents metal from oxidizing or corroding.
Anti-Friction. These additives melt out of the oil if the metal happens to touch.
Anti-foam agents. Prevent bubbles when the oil is whipped up by the moving of parts.
Oil comes in many different weights. The lighter oil is what’s burned off from driving, leaving the heavy oils behind.
So why change your oil, if it already has all these good things?
Eventually, the additives wear out. If you keep driving on worn-out oil, black gooey sludge forms at the bottom of your engine. Without the anti-friction additive, the oil burns onto your engine parts. All of these issues require a deeper (more expensive) engine clean to remove. Having the same oil also wears out your piston rings.
But the damage can get worse the longer you wait.
The more time between oil changes, the higher chance you have of those pistons seizing or a camshaft being damaged. Replacing any of these parts is much more costly than a routine oil change.
While regular changes seem unnecessary, having clean oil cycle through your engine will save you in the long run.