Poor sleep, stress, dehydration, smoking habit etc
Fluctuations in estrogen, such as before or during menstrual periods, pregnancy and menopause, seem to trigger headaches in many women.other general causes includes stress or tension. Missing meals, fatigue, lack of sleep, smoke or some sort of odor, change in the weather like rising humidity, heat.
The simple reason could be that for some people food is a triggering factor of migraine. Once the food is thrown up, the pain is automatically relieved.Or it just could be shifting your attention from the pain while trying to vomit. It releases the intracranial pressure.Relieving factors differ from individual to individual