In one lineCaffeine is a substance in coffee and tea that blocks adenosine, the brain’s sleepiness signal, so you feel less sleepy.
While you are awake, your brain slowly fills up with a chemical called adenosine. It is like a “you’re tired” signal. The more there is, the sleepier you feel. Caffeine has a shape very much like adenosine, so it sits in adenosine’s seats first. Now the brain can’t get the tired signal, and you feel less sleepy. Your tiredness is not gone. You just turned off the notifications. When the caffeine wears off, all the waiting notifications arrive at once.
Common mix-up“Coffee dries you out” goes too far. At normal amounts, it counts as drinking water, more or less.