Just like humans, a dog goes through sleep stages. They have 3 stages: NREM, REM & SWS.
Non-REM & SWS (Short Wave Sleep) sleep is lighter, though restful. REM (Rapid Eye Movement) is deep & full of twitching/eye-fluttering/whimpering/grumbling/dreams and more.
Avoid waking your pooch during REM. They may be agitated and confused or scared. They can have bad dreams too! If
Dogs who sleep in a more stretched out position have more REM Sleep than those curled up due to muscle tension. If always curled, expand their sleep area & provide a snugly blanket for warmth. They may be curled because they are cold. If they are often on their back, it’s probably to cool down, by exposing their belly (less hair). Belly exposure also means they feel safe.