“Psychiatric comorbidity” was the general term since early 1990s, now is a new category of secondary headache introduced in the 2004 revision of the ICHD. Most common relationship between psychiatric illness and headache is bidirectional and associational rather than causative. There is limited evidence to support psychiatric causes of headache, but suggesting that migraine, tension-type, and cluster headache may be attributed to psychiatric disorders. The greater risk a patient with migraine or depression has of developing the other disorder seems related in most cases to shared underlying serotonergic abnormalities of the central nervous system. The underlying neurochemistry of many primary headache disorders, especially migraine, has much in common with the neurochemistry (indole and biogenic amines) of various psychiatric illnesses. A complete diagnosis and treatment planning should not leave aside a psychiatric assessment.
https://ichd-3.org/12-headache-attributed-to-psychiatric-disorder/