While it would seem that it would make sense, this statement is misleading as caffeine has the power to both trigger but also ease headaches.
The most common cause of caffeine-induced headaches is withdrawal. People can become too dependent on caffeine, and upon stopping intake, within 12-24 hours, irritation may occur. The Mayo Clinic's report concluded that when caffeine is consumed regularly, the body becomes dependent on its effects...And because caffeine narrows the blood vessels that surround the brain, when consumption is stopped, the blood vessels enlarge. This causes an increase in blood flow around the brain and the pressures surrounding nerves. This can then trigger what is known as a caffeine withdrawal headache." (https://www.mayoclinichealthsystem.org/hometown-health/speaking-of-health/does-caffeine-treat-or-trigger-headaches)
In the same way, having too much caffeine may cause the same problems as it can create other health-related problems like an elevated heartbeat, often known as the "jitters."
On the positive note, this claim can be disproved as caffeine also cures headaches, and's most effective way is by boosting the effectiveness when using medication like ibuprofen or acetaminophen. (https://www.healthline.com/health/caffeine-and-headaches)
As anything is said to be, it is good to consume caffeine in a cautious way and in a moderate amount, with caution to the negative effects.