AFAIK it's a manifestation of an allergy. The smell of onions gives me a bad headache, but if I accidently eat them, then I get a migraine and accelerated bowel schedules. 😕 A lot of mold allergies (typically you don't really smell mold, but you still inhale the spores) are manifested as headaches and fatigue.
ups