Caffeine reduces the body's inclination toward feeling tired in two main ways.
First, caffeine mimics a naturally occurring chemical called adenosine and binds to the brain's adenosine receptors and the adenosine receptors in other organs of the body. The receptors are blocked by caffeine, which prevents adenosine from binding to them. Adenosine's role in the brain is to slow down nerve impulses and cause drowsiness, so caffeine's presence inhibits this reaction and increases alertness and responsiveness. In their stimulated state, nerve cells can release the hormone epinephrine (adrenaline), which increases heart rate and blood pressure, increases blood flow to muscles, decreases blood flow to the skin and organs, and prompts the liver to release glucose (a form of liquid sugar which supplies the body with energy).
Second, caffeine increases dopamine levels in the brain. Dopamine is a naturally occurring chemical responsible for feelings of well-being and happiness. Therefore, caffeine tends to improve one's mood. This is thought to be the primary reason that caffeine is an addictive substance.
How Much Caffeine is Safe?
For most people, about 300 mg of caffeine a day is a healthy level of caffeine consumption. That is roughly equivalent to three cups of coffee. However, caffeine levels in coffee, tea and chocolate vary widely, and some people experience symptoms of excess caffeine consumptions after consuming as little as 100 mg of caffeine, so be sure to check how much caffeine is in your favorite products if you are concerned about your caffeine intake. (Side note -- Contrary to popular belief, dark roast coffee generally has less caffeine than light roast coffee.)