Caffeine is a bitter-tasting chemical related to the nucleic acid bases adenine and guanine.

Produced by a range of plants to deter herbivorous animals from consuming their leaves or seeds, the compound is somewhat ironically prized by us humans for its flavor, not to mention its effect as a stimulant.

In fact, caffeine is the most widely used psychoactive substance around the globe, with as many as four in five adults consuming the compound in the form of a hot or cold beverage such as coffee, tea, or soda, often to stave off drowsiness.

In simple terms, this stimulation occurs thanks to caffeine's similarity to a chemical we produce to slow down nerve firing. By interfering with that chemical's slowing effect on the brain, our neurons remain active where they'd otherwise be winding down, setting off a chain reaction that can promote a 'fight or flight' response throughout the body.

Why do you sometimes feel sleepy?

Sleep involves a complex mix of biological functions that could have evolved long before animals even had brains.

Yet for those that do have nervous systems, a critical part of winding down for the day is the gradual accumulation of a compound called adenosine.

As our bodies work, this compound builds up in the brain's tissues, locking into receptors in the membranes of certain nerve cells and reducing their firing rate.

Some of those nerves are linked with muscle function, resulting in that heavy, lethargic feeling as the hours grind on. There is also an effect of dilating blood vessels to ensure the brain still gets a good supply of oxygen. Other nerves are connected to circuits that manage moods, which helps explain why exhaustion isn't exactly a happy feeling.

To clean out the fog of adenosine and feel recharged, we simply need to stop working, find somewhere quiet, and drift off to sleep. Once we wake, those receptors will be clear again and the nerves firing at full capacity, at least until they clog with adenosine once more.

Caffeine lingers around those receptors, making it hard for adenosine to slide back in. Within two hours of having swallowed a cup of coffee, the concentration of caffeine will hit a peak in the brain, giving your mood a buzz and helping your muscles feel less heavy for a bit longer. It also constricts blood vessels in the brain.

So why does caffeine make you feel not just awake, but energized?

By allowing certain nerves in the brain to continue firing at a relatively rapid pace, we're in effect telling other circuits – like those linked with the pituitary gland – that something exciting is happening.

It responds by releasing epinephrine, a hormone that generates responses we might need in times of stress or danger. Our heart beats a little faster, pupils dilate, blood is diverted to our muscles, and stored carbohydrates are released from the liver.

Is caffeine dangerous?

Generally speaking, most people with a habit of consuming the equivalent of one to four cups of coffee a day – around 400 milligrams of caffeine in a 24 hour period – face no clear risks to their health.

In fact, a small amount of caffeine might even have a few small, but not insignificant benefits, including preventing heart disease, helping muscles burn calories, and possibly even boosting your chances of living longer.

Be warned, though: Even a cup-a-day habit can produce a physical dependence that punishes withdrawal with headaches, lethargy, and irritability.

Having a habit that exceeds a few cups a day, or involves adding piles of sugar or other additives to your diet, can quickly eliminate those benefits. Then there's the fact that adenosine is actually doing your body a favor, preparing you for the necessary amounts of sleep you'll need to clean up your brain and repair your body.

For those who are pregnant, drinking any amount of caffeine also presents a possibility of risk, depending on who you ask.

Caffeine does have a lethal dose, with deaths reported at concentrations of around 80 to 100 micrograms of caffeine per milliliter of blood. It would require consuming around 10 grams of pure caffeine to receive this amount of caffeine, something hard to manage on coffee alone. But isn't unthinkable with crystalline forms of concentrated caffeine in the form of a powder or pills, which are thought to have played roles in a small number of recorded deaths in the past.

So enjoy that morning mug or two of wake-up juice, and maybe go to bed a little earlier to get the most of both sleep and caffeine.

All Explainers are determined by fact checkers to be correct and relevant at the time of publishing. Text and images may be altered, removed, or added to as an editorial decision to keep information current.