What happens when I close the lid on my MacBook Pro running OS X?
Short Answer
MacOSX uses Hybrid Sleep. When closing the lid, the desktop state is written to both RAM and disk.
Then, while the computer still has enough power for the RAM, it wakes from RAM (sleep). However, in case the power gets cut, the computer wakes from the disk (safe sleep).
Keep in mind, that the battery isn't actually at it's lowest charge when switching to safe sleep. It still keeps some charge left. Therefore, if you want to fully drain your battery, the computer must stay in safe sleep for several hours until the white led stops 'breathing'.
Long Answer
Here is an excerpt of the official Apple Documentation:
On all Macs:

The microprocessor goes into a low-power mode
Video output is turned off, and a connected display may turn off as well, or enter its own idle state
Apple-supplied hard disks spin down; third-party hard disks may spin down

On portable Macs:

The Ethernet port turns off, if applicable

Expansion card slots turn off

The built-in modem, if present, turns off

An AirPort card, if present, turns off

The USB connection only responds to the power key on an external keyboard

The optical media drive spins down

Audio input and output turns off

Keyboard illumination, if a feature of your portable computer, turns off