The brain does not feel pain within itself.
While there are many pain-sensitive areas surrounding it, the tissue of the brain lacks the pain receptors (or nociceptors) that cause a person to experience the sensation of pain. In fact the brain contains no sensory system of any kind, meaning changes in temperature, pressure or damage to brain tissue cannot be felt by the brain unless they affect an area connected to the nervous system.
Therefore, in actuality, headaches, no matter how severe, do not stem from any disruption in the brain itself. Rather, they occur because of disturbances or abnormalities in the structures surrounding the brain, including the many nerves, muscles, arteries, veins and subcutaneous tissues as well as the eyes, ears, sinuses and the cranium.
In fact a person may never detect the presence of a brain tumor or cyst unless it begins to exert pressure on the surrounding nerve tissue or blood vessels.
This peculiarity has become quite useful in many brain surgeries since the brain itself need not be anaesthetized to prevent pain and the conscious patient can respond to functional tests (such as speech or motor tasks) preventing the surgeon from damaging critical brain areas.
It is also for this reason that patients- such as in the renowned case of Phineas Gage, or the more recent case of Eduardo Leite– report feeling little pain after surviving an incident in which their brain has been penetrated by a piercing object.
This really is a very interesting anatomical quirk, and from a cognitive perspective it actually makes good sense. We have pain receptors in other areas of our body to alert us to injury and tissue damage. The brain however is not exposed to such a degree as other areas of our body due to the protective layers that surround it.
Furthermore, the brain is very busy allowing us do what we do. Why should such an active organ waste energy sensing itself when there are bodyguards, in the form of protective layers, in place to lock it out of harms way? It’s up to the many other higher-order processes of the brain to make sure we exert caution should we find ourselves in the presence of any wayward metal spheres…