Two very different brain states
Sleep is not one uniform state. In REM sleep the brain is highly active, with patterns on an EEG closer to waking, and this is when vivid story-like dreams are most common. The body, by contrast, is largely paralyzed: a temporary loss of voluntary muscle tone (atonia) stops you from acting out dreams. Eyes dart, and breathing and heart rate become irregular.
NREM sleep runs the other way. Brain activity slows into large synchronized waves, especially in deep N3, while the body retains some muscle tone and basic functions stay steadier.
Different jobs for each state
The two states are thought to support different kinds of restoration. Deep NREM is associated with physical recovery and with consolidating fact-based (declarative) memory, while REM is linked to emotional processing and certain procedural and creative aspects of memory. The brain alternates between them through the night rather than choosing one.
These roles are still actively researched and described as associations rather than settled certainties. This is general educational information about sleep neuroscience, not medical advice.