What caffeine does do is one heck of an impersonation. In your brain, caffeine is the quintessential mimic of a neurochemical called adenosine. Adenosine is produced by neurons throughout the day as they fire, and as more of it is produced, the more your nervous system ratchets down.
Your nervous system monitors adenosine levels through receptors, particularly the A1 receptor that is found in your brain and throughout your body. As the chemical passes through the receptors, your adenosine tab increases until your nervous system pays it off by putting you to sleep.