My mother had a stroke and for weeks afterward was under the impression that I was a nurse who she disliked.
Our minds are very complex systems of chemical reactions. They work most of the time. There is weird, marvelous, scary stuff up there, and we barely understand any of it.
Quora user Lazlo B Tamas would be a good person to ask, though coincidentally he has already gave his answer to the question itself and didn't address this answer.
For years I've suffered from headaches and I feel the cause is almost always a lack of oxygen (I suppose) to my brain. I've realized I definitely suffer from shallow breathing and over the past few years I've learned to breathe deeper. It has definitely helped a lot, though I always wonder if there's something else.