Caffeine works in two ways to make you feel that way.
First it prevents the brain from telling you that you are tired. You can think of your brain as a bunch of locked boxes with different things inside of them. Some of these boxes have things that make you happy, others make you sad. Some have things that tell you it is time to go to sleep. Caffeine jams itself into the lock on the sleepy time box so that your brain can’t open it. That keeps you from feeling tired.
Caffeine also can help open the box that tells your body to go into extra energy mode. Things like your heart can work faster or slower depending on what you need. If you are sitting on the couch watching TV it’s going to go slower, if you are outside working it’s going to speed up. Caffeine tricks the body into thinking it needs to go into extra energy mode. Caffine doesn’t create this energy, the body is just using what it has stored more quickly. Not really any different from you step on the gas in a car. You are telling it to burn more fuel and go faster.
Caffeine doesn’t actually give you a burst of energy – it just feels like it does because it prevents the feeling of being tired.
Caffeine binds to the same place in your brain that adenosine molecules would. Adenosine is what tells your brain “okay, time to start feeling sleepy”. Adenosine can’t bind to those receptors now and so your brain isn’t getting the “its bed time now” signals. The extra adenosine in your bloodstream (since it’s not binding to anything now) also may trigger your adrenal system to release more adrenaline. It also affects the dopamine system in the brain, which is what produces the hormone that makes you happy/feel good.
Imagine your brain has a bunch of guys running around delivering messages. Each message has a specific box. So the more tired you get, the more guys you have running around writing “I’m tired” messages and putting them in the “I’m tired boxes”.
Caffeine comes along and fills those “I’m tired boxes” so there’s nowhere for anyone to put the “I’m tired” messages. This keeps you from feeling tired.
Caffeine is a drug, and like most drugs the part of your body it affects is your brain. Caffeine doesn’t give you more energy, it tricks your brain into thinking you’re not out of energy.