There are two theories. The first: A headache happens when the body releases adenosine, a chemical that inflames blood vessels, causing throbbing and pain. The caffeine in coffee puts the kibosh on adenosine and helps constrict blood vessels. The second theory posits that caffeine increases the effectiveness of pain relievers, helping the body absorb them more quickly for faster relief. Hence, many pain pills contain caffeine, and that's why popping Advil with your joe can help your noggin.