If you're hibernating, that would mean you have hybrid sleep enabled too, likely. Making that assumption, here's how it works in a nutshell. When you put the machine to sleep, it's doing both sleep and hibernate operations - the information in RAM is written to disk, and the machine goes into a low-power state (very low power). However, certain system timers still fire (scheduled tasks, power events, etc), and thus when the hibernation timeout passes, the machine simply hibernates (turns off). Since the memory is already on disk, it can just shut off at that point without having to go through most of the laborious process of writing memory to disk.