Motor oil is a crude oil product. It's refined out of the same stuff that makes gasoline, nylon clothing, and CD parts.
That's right — your motor oil is made of liquefied dinosaurs and plant matter.
Motor oil does much more than lubricate moving engine parts. It cools the engine by transferring heat from the cylinders, much like coolant. You'll find that many oilpans — those dealies on the undercarriage that hold the oil — are equipped with fins to disperse accumulated heat. It exploits surface tension to seal pistons, preventing burnt fuel and carbon from squeezing down past the piston head (a phenomenon known as blow-by). It collects dirt.
Motor oil is the blood and mucus of your vehicle.
Additives
Even without additives, motor oil has good viscosity and carries heat well. Actually, the base fluid that comprises motor oil never "goes bad" — if it weren't for additives and environmenal factors, motor oil would last forever. But put oil into an engine on its own and you'll find that it eats the metal, and the grime it picks up from normal circulation quickly changes it into a sludged soup. Additives preserve the engine itself from the wearing effects of oil, maintain its consistency, and reduce the effects of accumulated dust.
So what are the additives?
About 30% of your average jug of motor oil is additive. Tiny wax crystals, oxidation inhibitors, detergents, dispersants, rust inhibitors. Additives prevent the oil from taking its natural bare course of sludging and corroding engine parts. Oil oxidizes as a natural result of the combustion process taking place in the cylinders, promoting rust (some engine metals actually act as a catalyst to oxidization). Accumulated dirt clumps together and clogs the latticework of spaces within the engine where oil flows. In cold temperatures oil gets so thick that it's useless. Additives help prevent all that.
Oil levels
Of course, the amount of oil you've got in your vehicle is important.
Too little oil contributes to friction and overall wear and tear. Every moving part in the engine is optimally coated with a thin film of motor oil, preventing the harsh metal parts from rubbing together, producing friction, and heating up. When metal gets hot it gets soft; and when metal gets soft it's no good.
Too much oil can be just as bad. Excess oil is stored in the oilpan on the undercarriage of the vehicle. The crankshaft — a complex series of cranks that controls a number of automobile functions which are the stuff of another writeup — is suspended across the space just above the oilpan and can be submerged in oil. Horsepower is lost because the shaft is spinning in a viscous liquid, and as it spins the oil foams up like beat eggs. Foamed oil is worthless.
If you're going to endeavor an oil change in the safety of your garage, you'll want to refer to the owner's manual of your vehicle for recommended oil levels.
Viscosity and ratings
If you've ever bought a quart of oil, you probably matched its viscosity to that specified by the manufacturer of your vehicle — for example, 5W-30. But what does that number mean?
All motor oil is rated by viscosity. Viscosity is a fancy way of specifying how thick the oil is. 30 is thinner than 40 and thicker than 20.
I'm getting ahead of myself a little.
Legitimate motor oil in the US is typically rated by two groups — the Society of Automotive Engineers, or SAE; and the American Petroleum Institute, or API.
SAE ratings are the most common. That's the 5W-30 from a few paragraphs ago. 5W-30 oil has a viscosity rating of thirty and is suitable to -5°F. W stands for "Winter," not "weight." Some oils do not carry a winter rating and should not be used in any climate.
Any harsh climate, that is. Anywhere but Southern California and the more temperate regions bordering the Mediterranean are really pretty much off limits.
API rates oil based on its quality rather than its viscosity, using such factors as longevity, cleanliness, and hardiness in different temperatures and under different pressures. Consequently, API's ratings are somewhat more dynamic than SAE's and its standards change nearly every year. Ratings are denoted alphabetically — SA, SB, SC, SD, etc. Oil currently falls in the SL range.
The US Military has gotten into the game as well, contracting with engine manufacturers to supplement the judicious use of oil in military craft. SAE and API ratings are typically used in conjunction with these military ratings; however, if an oil's got a military rating stamped on it, it was likely developed specifically for military application.
And what about synthetic oils?
Synthetic oils aren't refined from crude oil but manufactured chemically from things like alcohol, acids, wood, and other agricultural resources.
Originally, synthetic oils were limited to aircraft because they handle high temperatures and pressures better than natural oil. Recently they've been introduced to passenger cars as a viable alternative to the natural stuff. Synthetics are slower to oxidize, evaporate less, are less apt to change viscosity under different temperatures, improve fuel mileage, and clean engine parts more effectively.
But they're not so good with break-in, meaning they aren't good for brand new vehicles. You don't want to start using synthetic oils until you've put about 5000 miles on the engine. They're also bad for old engines, burning off where they form seals in the piston rings. They're more expensive. They can't be mixed.
drinkypoo adds that outside the US vegetable-based motor oil is available and that nylons were originally made of coal, which is even weirder than oil.
Sources
Schwaller, Anthony E. "Total Automotive Technology, Fourth Edition." Thomson/Delmar, Clifton Park.
Nordic Group
http://www.nordicgroup.us/oil.htm
STP
http://www.stp.com/faq_oil.html
Longhurst, Chris, "The Engine Oil Bible."
http://www.chris-longhurst.com/carbibles/engineoil_bible.html