According to the internet:
Sleep apnea is literally when a person stops breathing during sleep. As a result, the brain undergoes repeated moments of suffocating. In popular culture, snoring is viewed as funny, and people often laugh when a snoring person lets out a sudden explosive snort. The reality is this loud snort is often the person gasping for air, as the brain is not getting enough oxygen. Sleep apnea interrupts sleep for both the sleeper and their bed partner. In the case of a female patient whose husband refuses to get evaluated despite showing signs of sleep apnea, I often urge the patient to bring their husband with them to their next appointment with me. Whether it’s the patient or the spouse, I often hear the line, “I have always slept this way.” When that happens, I explain that poor sleep is like alcohol. In our 20s, drinking a six-pack of beer would lead to a rough morning after, but the same six-pack of beer in our 50s can require a week to fully recover from. Likewise, recovering after an all-nighter without sleep in our 20s tends to be much easier than trying to pull an all-nighter in our 50s. That being said, younger brains tend to be more resilient with toxic situations, like alcohol consumption and sleep dysfunction, than the same brains later in life.
If improvement of headaches, mood, energy, wakefulness, memory, and cognition are not motivation enough, I also advise that untreated sleep apnea leads to an increased risk of stroke, heart attack, and dementia (brain damage). That usually gets people’s attention, and reduces the need for me to perform unnecessary surgeries like a husbandectomy to allow the wife with insomnia to get a good night’s sleep, and subsequently less headaches.
Source: Snored to death: The symptoms and dangers of untreated sleep apnea
So in a way your brain was starting to experience death by lack of oxygen.
For many years I snored which kept my wife awake all night. She was a light sleeper. I had weight loss surgery and lost significant weight. One of the side effects of the surgery was that my sleep apnea went into remission and has remained in remission for 5 years now. I would wake up sometimes and find my wife hovering over my body. I asked her what she was doing. She would say that I was sleeping so soundly that she thought I died and she was checking to see if I was still alive.