Headaches happen because pain-sensing nerves around your brain become activated, even though the brain tissue itself cannot feel pain. About 40% of the global population, roughly 3.1 billion people, deals with a headache disorder. The pain you feel originates in the network of nerves surrounding your brain, the blood vessels feeding it, and the layers of tissue (called meninges) that wrap around it. Different triggers activate this system in different ways, which is why headaches can feel so varied.
Your Brain Can’t Feel Pain, So What Hurts?
Brain tissue has no pain receptors. The pain comes from structures surrounding it: blood vessels on the brain’s surface, the protective membranes covering the brain, and the muscles and skin of the head and neck. These structures are densely packed with nerve fibers that detect pressure, stretching, inflammation, and chemical changes.
The main nerve responsible for most headache pain is the trigeminal nerve, which branches across your face and skull in three divisions. The uppermost branch, running across the forehead and top of the head, carries the majority of pain signals from the brain’s coverings. When something irritates the blood vessels or membranes around the brain, these nerve fibers fire off signals that travel down into the brainstem and then up to areas of the brain that process pain, emotion, and autonomic functions like nausea and changes in heart rate. That’s why a bad headache doesn’t just hurt. It can make you feel sick, sensitive to light, or deeply fatigued.
When these nerve endings are activated, they release signaling molecules that cause nearby blood vessels to dilate and surrounding tissue to become inflamed. This creates a feedback loop: inflammation activates more nerve fibers, which release more inflammatory signals, which amplifies the pain. One key molecule in this process is CGRP (calcitonin gene-related peptide), which has become a major target for newer migraine treatments precisely because it plays such a central role in this cascade.
Tension Headaches: The Most Common Type
The dull, band-like pressure that wraps around your forehead or the back of your skull is almost always a tension-type headache. These are the most common headache type, and they’re closely tied to stress, poor posture, and prolonged muscle tightness in the head and neck.
The exact mechanism isn’t fully settled, but the leading explanation involves two phases. First, muscles in the scalp, jaw, and neck contract and stay contracted, sometimes due to stress, eye strain, or sitting hunched over a screen. This sustained tension can reduce blood flow to those muscles and trigger the release of pain-producing substances, including substance P, a molecule that amplifies pain signals. Specific tender spots in these muscles, called trigger points, can radiate pain into broader areas of the head.
People who get occasional tension headaches tend to have heightened sensitivity in these peripheral muscles and nerves. But when tension headaches become chronic (15 or more days per month), the problem shifts. The central nervous system itself becomes sensitized, meaning the brain starts interpreting normal signals as painful. At that point, it’s not just tight muscles causing the problem. The brain’s pain processing has been turned up.
What Happens During a Migraine
Migraines involve a much deeper disruption. One leading theory centers on cortical spreading depression, a slow wave of intense nerve cell activity that sweeps across the brain’s surface, followed by a period of suppressed activity. This wave is thought to cause migraine aura, the visual disturbances (flashing lights, blind spots) that about a quarter of migraine sufferers experience before the pain starts.
As this wave passes through the brain, it triggers the release of ATP, glutamate, potassium, hydrogen ions, and CGRP from neurons and surrounding cells. These substances spill onto the meninges and activate the trigeminal nerve endings embedded there, kicking off the inflammatory pain cascade described above. Blood vessels dilate, tissue swells, and the trigeminal system sends escalating pain signals deep into the brainstem and up to the thalamus, which acts as the brain’s relay station for sensory information.
From the thalamus, signals fan out to brain regions governing not just pain but also nausea, light sensitivity, mood, and concentration. That’s why migraines are a full-body experience, not just a bad headache.
Cluster Headaches and Your Internal Clock
Cluster headaches are rarer but extraordinarily painful, often described as a stabbing or burning sensation behind one eye. They tend to strike at the same time each day, often waking people from sleep, and they come in “clusters” lasting weeks or months before disappearing for a period.
This clockwork timing points directly to the hypothalamus, a small structure deep in the brain that governs your circadian rhythm. The suprachiasmatic nucleus, the brain’s master clock located in the hypothalamus, is calibrated by light exposure and synchronizes biological rhythms throughout the body. It connects to the pineal gland (which releases melatonin), the autonomic nervous system, and the pituitary gland. In people with cluster headaches, multiple aspects of circadian biology show abnormalities, including altered expression of core clock genes. The hypothalamus essentially misfires at predictable intervals, activating the trigeminal nerve and autonomic pathways on one side of the face, producing intense pain along with a drooping eyelid, tearing eye, or nasal congestion on the affected side.
Dehydration and Brain Shrinkage
When you’re dehydrated, your brain physically shrinks. It contracts and pulls slightly away from the skull, tugging on the pain-sensitive membranes that anchor it in place. This mechanical stretching activates nerve fibers and produces a headache that typically affects the whole head and worsens when you stand up, bend over, or move around. Rehydrating reverses the process. As fluid levels normalize, the brain returns to its usual volume and the pulling stops. Most dehydration headaches resolve within one to three hours of drinking water, though severe dehydration takes longer.
How Sleep Affects Headache Pain
Your brain generates a surprising amount of metabolic waste relative to its size. It accounts for roughly 40% of the body’s total energy consumption despite weighing only about three pounds. During sleep, a waste-clearance network called the glymphatic system ramps up activity. Brain cells shrink slightly during sleep, expanding the channels between them and allowing cerebrospinal fluid to flush out toxic byproducts that accumulated during the day.
When you don’t sleep enough, this cleaning process is dramatically reduced. Excitatory chemicals, inflammatory molecules, and metabolic waste build up in the spaces between brain cells. This chemical buildup can directly irritate the pain-sensing structures around the brain. To make things worse, headaches themselves can disrupt sleep by interfering with glymphatic function, creating a cycle where poor sleep causes headaches and headaches cause poor sleep.
Caffeine Withdrawal
Caffeine works by blocking adenosine receptors in the brain. Adenosine is a molecule that accumulates while you’re awake and promotes drowsiness. It also dilates blood vessels. By blocking adenosine, caffeine keeps you alert and slightly constricts blood vessels in the brain. Over time, your brain compensates by producing more adenosine receptors, effectively turning up the volume on the adenosine system.
When you suddenly stop consuming caffeine, all those extra receptors are flooded with adenosine. Blood vessels in the brain dilate significantly, increasing cerebral blood flow and stretching the pain-sensitive vessel walls. Dopamine release in the prefrontal cortex also drops, contributing to the fatigue and low mood that accompany withdrawal headaches. These headaches typically begin 12 to 24 hours after your last dose of caffeine and can last several days.
Food Chemicals That Trigger Pain
Certain compounds in food can directly affect the blood vessels and nerves involved in headache pain. Nitrates, found in processed meats like hot dogs and deli meats, are converted in the body to nitric oxide, a powerful molecule that relaxes and widens blood vessels. This dilation of the large arteries in the skull can trigger an immediate headache in some people. In migraine-prone individuals, nitric oxide goes further, stimulating the release of CGRP and glutamate, which can set off a full migraine hours later.
Tyramine, found in aged cheeses, fermented foods, and some wines, can also provoke headaches, particularly in people who are sensitive to it. Alcohol has a dual mechanism: it causes immediate vasodilation and also increases dehydration, combining two headache-producing forces at once.
When a Headache Signals Something Serious
The vast majority of headaches are not dangerous. But certain patterns suggest a secondary headache caused by an underlying condition that needs medical attention. A sudden, explosive headache that reaches maximum intensity within seconds, sometimes called a “thunderclap headache,” can indicate bleeding in the brain. A headache accompanied by fever, stiff neck, confusion, or seizures may point to an infection like meningitis.
Other warning signs include a new headache pattern starting after age 65, headaches that worsen progressively over days or weeks, pain triggered specifically by coughing, sneezing, or exertion, headaches accompanied by vision changes or weakness on one side of the body, and pain that changes dramatically with position. A headache following a head injury, or one developing in someone with a compromised immune system, also warrants prompt evaluation. None of these patterns are guaranteed to mean something dangerous, but they are the signals clinicians take seriously and investigate further.

