Why onions and garlic causes a headache: there is a reason
BLOG
Have you ever noticed that you get a headache after eating raw garlic or onions? Not everyone does, but some people can track this pattern exactly. Garlic contains a sulfonyl-hydroxyl ion that penetrates the blood of the meninges (it has a high penetrating power) and is particularly poisonous to higher mammals. Observe yourself after a "garlic" lunch or dinner. According to research, garlic can slow down thinking. It suppresses the thought processes and it is poisonous to the brain, as sulfonyl-hydroxyl ions penetrate any membranes, including the brain. Ascetic monks avoid onions and garlic, as they know that concentration and prayer will not be normal afterward.
About onions in short, in the words of Avicenna:
"Onions are among the substances that cause headaches, and the abuse of it overtakes sleep. Onions are one of the substances harmful to the mind. Eating leeks causes headaches and bad dreams. Leek is harmful to eyesight, it is harmful with ulcers of the bladder and kidneys."
So, "onions cure seven diseases" may be justified when there is ARVI, but there are enough headaches and drowsiness there... in general, you choose.
It seems to me, rather, according to my observations, there are some people who are especially sensitive to raw garlic and onions, so it is better for them to avoid these products. For the rest, I would simply advise refusing onions and garlic before exams and other mental stress.