This article looks at [http://neurosciencenews.com/migraine-oxidative-stress-7761/ |the function of migraine]: 

"Previous research has suggested that individuals who experience migraines have higher levels of oxidative stress. Jonathan Borkum, PhD, of the University of Maine, notes that migraine triggers — including stress, sleep disruption, noise, air pollution, and diet–can increase brain oxidative stress, an imbalance between the production of free radicals and the ability of the body to counteract their harmful effects. “Oxidative stress is a useful signal of impending harm because a number of unfavorable conditions in the brain can give rise to it,” said Dr. Borkum. Therefore, targeting oxidative stress might help prevent or preempt migraines.

In his Views and Perspectives article, Dr. Borkum looks closely at the components of a migraine attack individually. In the context of a known threat to the brain — an interruption in blood supply–each of the components is protective: strengthening antioxidant defenses, lowering the production of oxidants, lowering energy requirements and, especially, releasing growth factors into the brain that protect existing neurons and support the birth and development of new neurons. “There are feedback loops between these components of a migraine attack that tie them together into an integrated system,” Dr. Borkum explained. “Thus, it seems likely that migraine attacks are not simply triggered by oxidative stress, they actively protect and repair the brain from it.”

This clearly goes in line with migraine as a symptom to discharge stored energy, as in a healing peak.