Whether it’s consumed as coffee, candy, or toothpaste, caffeine is the world’s most popular drug. If you’ve ever wondered how a shot of espresso can make your groggy head feel alert and ready for the day, TED-Ed has the answer.

Caffeine works by hijacking receptors in the brain. The stimulant is nearly the same size and shape as adenosine, an inhibitory neurotransmitter that slows down neural activity. Adenosine builds up as the day goes on, making us feel more tired as the day progresses. When caffeine enters your system, it falls into the receptors meant to catch adenosine, thus keeping you from feeling as sleepy as you would otherwise. The blocked adenosine receptors also leave room for the mood-boosting compound dopamine to settle into its receptors. Those increased dopamine levels lead to the boost in energy and mood you feel after finishing your morning coffee.

For a closer look at how this process works, check out the video below.

[h/t TED-Ed]