It depends on what sleep cycle you wake up in the middle of
Your sleep consists of different stages: NREM (Non-Rapid Eye Movement) and REM (Rapid Eye Movement). NREM includes deep sleep, and REM is associated with dreaming.
During a full sleep cycle (lasting around 90 to 110 minutes), you go through these stages multiple times. Waking up during deep sleep (NREM) can lead to sleep inertia, making you feel groggy. If you wake up during REM or lighter NREM sleep, you're more likely to feel refreshed.
So, it's not just about how long you sleep; it's also about the specific stage of sleep you're in when you wake up. Waking up at the right time in your sleep cycle can influence how rested and alert you feel.
I hate that I know that, but that where those "me sleeping for 8 hours and being tired VS me sleeping for 2 and feeling energized" memes come from