Left on its own, iron will gradually corrode and rust due to the oxygen and moisture in the air. Luckily, the same properties that cause iron to corrode allow it to be protected! Iron is actually not completely solid, but is really quite rough and porous. During the seasoning process, fat sinks into the pores and seals the metal from the air.
Next, the fats themselves oxidize when the metal is heated. According to Harold McGee in On Food and Cooking, this causes the fats to "bond to each other...to form a dense, hard, dry layer." Because the cast iron is so porous, this layer of oxidized fat stays locked to the surface of the metal like puzzle pieces.
We actually had a lot of trouble finding definitive, straight-forward information about what is happening on the microscopic and chemical level during the seasoning process or what properties of iron make any of this possible. Any physicists, chemists, or all-around smarties out there with anything to add?!