I’m sure this has already been said in the comments, and I didn’t read a single one because I felt like explaining it. Caffeine is an adenosine antagonist. That means it blocks adenosine.
Adenosine is a neurotransmitter that controls your sleep drive. It builds up while you’re awake and makes you feel tired. Drink some coffee and the adenosine gets blocked and you feel more awake.
Latest Answers