I guess it’s because while you’re sleeping, by default, your body tries to breathe through the nose. When the brain senses the congestion, it immediately reduces the swelling of the nasal passages.
You can also try to forcefully breathe through your nose while you’re awake and the congestion will lessen after some time. It’s just the reflex action of brain towards the lack of oxygen.
Latest Answers