Headaches are generally classified by cause:
A primary headache is caused by problems with or overactivity of pain-sensitive structures in your head. A primary headache isn't a symptom of an underlying disease. Chemical activity in your brain, the nerves or blood vessels of your head outside your skull, or muscles of your head and neck — or some combination of these factors — may play a role in primary headaches. Some people may carry genes that make them more likely to develop such headaches.
A secondary headache is a symptom of a disease that can activate the pain-sensitive nerves of the head. Any number of conditions — varying greatly in severity — may cause secondary headaches