Just as you feel a muscle “burn out” when it's getting stronger, your brain needs to feel some discomfort when it learns. Your mind might hurt for a while, but that's good. After publishing an especially challenging article on quantum mechanics, it's not uncommon to hear some of our readers complain that their heads hurt. Presumably, they mean that the article caused them a (metaphorical) headache.
But in reality, it's possible that challenging the brain causes some physical damage to nerve cells in the brain. Researchers say that when there are situations in which the brain is active, it is possible to detect signs of damage to the DNA of the cells of that brain. Usually, the damage is restored quickly, but they hypothesize that the inability to repair it quickly enough may be the cause of some neurological diseases. Your mind is full of thoughts and beliefs.
The pain associated with learning is part of a self-defense mechanism. Your brain is lazy and chooses the easiest path; your mind is concerned and can be deceitful. You must tame your mind to prevent thoughts from eating you alive, as I wrote here. In addition, lack of sleep can cause headaches and migraines in some people.
And the combination of both factors, stress and irregular sleep patterns can actually have an impact on headaches. In a small observational study with patients with chronic tension headache and migraine, two consecutive days of high stress or little sleep were found to be “highly predictive of headache”.