While I believe this can just happen to some people, in my case it was a result of sleep apnea. Getting diagnosed for it and taking remedial steps has been a life changer for me.