Why coffee keeps you awake?

Caffeine works by changing the chemistry of the brain. It blocks the action of a natural brain chemical that is associated with sleep. The binding of adenosine causes drowsiness by slowing down nerve cell activity. In the brain, adenosine binding also causes blood vessels to dilate(presumably to let more oxygen in during sleep.)