Enough people report chocolate headaches and migraines that several epidemiological studies have been conducted, and cacao usually comes in fairly high on the list, following only stress, inconsistent sleep, menstruation, alcohol, and hunger.
That may sound like pretty clear evidence, but remember that epidemiological studies are usually based on self reporting. All it means is that if you ask people, lots of them will say chocolate causes migraines or headaches. When you get into the lab, the story changes. Double-blind studies, with control groups receiving a placebo instead of chocolate, reached very different conclusions. In those, participants who ate a carob-based placebo were just as likely to get headaches as those who ate real chocolate.
Why the discrepancy? It could have to do with small sample sizes. Even the largest double-blind headache study had only 67 participants. They may, through sheer bad luck, have gotten a disproportionately low percentage of people whose migraines are triggered by cacao. That theory is supported by some older, even smaller studies which only involved people who had already identified chocolate as a potential migraine trigger—they found a strong positive correlation between chocolate and headaches. So it’s possible that the large studies weren’t really big enough to accurately represent the population at large. It could also be that a few people get headaches from chocolate, and others just think they do.
If there are people who mistakenly believe that chocolate causes their headaches, they may have good reason for it. Stress and hunger are both common, well-known migraine triggers. People who are stressed or hungry are also likely to crave chocolate. The scenario would go: you’re stressed, so you’re craving chocolate, so you eat chocolate. Later on, you end up with a migraine because of the stress. It seems like chocolate was the cause, but if anything it was actually a warning of the impending headache.
There’s one more possibility. For some people, chocolate might be only part of the headache trigger. On it’s own, it may be fine. When combined with other factors like stress or sleeplessness, it could be the straw that breaks the camel’s back. This seems plausible, given the effects of the chemicals in chocolate. Theobromine and biogenic amines affect the nervous system. They also, like flavonoids, have an effect on blood pressure and heart rate. Since migraine headaches result from both neurological and vascular factors, it wouldn’t be surprising if chocolate has an effect on them.