Headaches are caused by anything that irritates the pain sensitive structures of the head and upper neck. These structures are cranial bones/sutures, dura mater, cranial blood vessels, muscles, ligaments and joints of the upper neck, sinuses, teeth, the TMJ, and muscles of mastication. This irritation can be caused by a space occupying lesion (e.g. tumor), infection, trauma, muscle tension, or somatic dysfunction in any of the pain sensitive structures listed above.
Ultimately, all pain is sensed and interpreted in the brain and for headaches this occurs in the trigeminal cervical nucleus. This is the area of the brainstem where nociceptive input arrives from the trigeminal nerve and the upper cervical spinal nerves. Multiple dysfunctions can become additive to the sensation of pain and pain is more likely to occur in a sensitized nervous system. Things that lead to neurologic sensitization include stress, fatigue, food sensitivities, hormones, drugs and medications, and genetics. Therefore, we need to look at headaches from the perspective of the tissue being irritated and the organ sensing the irritation.