When you breathe, air travels down your throat, through your windpipe and into your lungs. The narrowest part of that pathway is in the back of your throat.
When you're awake, muscles keep that pathway relatively wide open. But when you sleep, those muscles relax, allowing the opening to narrow. The air passing through this narrowed opening may cause the throat to vibrate. That causes snoring, which many people experience.
But in some people, the throat closes so much that enough air can't get through to the lungs. When this happens, the brain sends an alarm to open the airway. Most often this is associated with a brief arousal from sleep. The brain quickly reactivates the muscles that hold the throat open, air gets through again, and the brain goes back to sleep. This disorder is called obstructive sleep apnea.