The human brain and caffeine have a bittersweet relationship. To the brain, caffeine molecules resemble something called adenosine. The purpose of adenosine is to tell the brain to take it slow or feel sleepy or groggy. In other words, adenosine is good for you when it’s time to go to bed but not so beneficial when you’re working in the afternoon.
That’s when you search for caffeine. After taking it, the caffeine reaches the brain and binds to the receptors where the adenosine wants to go. The adenosine is left to hang around, and as a result, the brain doesn’t get the signal to make you feel sleepy. However, the caffeine doesn’t actually give you energy. It simply blocks the receptors to which adenosine would’ve connected and induced sleepiness.
Once the caffeine wears off, the free-flowing adenosine will reach the disconnected receptors, bind to them, and make you feel sleepy again. This is just a general outline of how caffeine works on the human body, but every individual experiences a different reaction because of the differences in body chemistry.