Sleep paralysis at its most basic is when you become conscious but your brain forgets to turn your body on. When we sleep, our brain turns our motor functions off so we don't act out our dreams. Even though we feel like we're actually moving in our dreams, we aren't in real life. It's an evolution mechanism to keep us from theoretically walking off a cliff, or tripping over something and hurting ourselves.
In some complex cases sleep paralysis can be a symptom of a medical problem, but if you're otherwise healthy I wouldn't worry about it. When I was younger there was a stretch where I was having sleep paralysis every night, then one day it stopped and never happened again.