According to science, sleep paralysis is a kind of miscommunication between your mind and body when waking up suddenly. Your mind is partially awake but your body is still asleep, causing the paralysis. When we sleep our body becomes paralyzed during REM sleep, to protect us from acting out our dreams, which could be quite dangerous for us. You go through different stages of sleep each night, but if you wake up during these short moments of REM sleep, you might experience sleep paralysis. REM sleep, also known as Rapid Eye Movements, is the dream stage, where we enter dreamland. It may feel like you have been dreaming the entire night, but you only dream for shorter periods of time each night. But dreams can be quite vivid and action packed, and so the body's natural paralyzing effect, serves us, so that we do not harm ourselves in any way.
There are two types of sleep paralysis, the hypnopompic and hypnagogic sleep paralysis.
This type of sleep paralysis is the most typical type, and here your mind wakes up before your brain, causing the miscommunication to appear. This is when you wake up in the middle of the night and can't move.
This type of paralysis is when you are falling asleep. If your body falls asleep faster than your mind, you can experience the paralysis. This usually does not happen by accident, but is a well known technique for people who are trying to experience lucid dreaming, as it will allow their mind to stay lucid as their body falls asleep.
Love and Light!