How does our body wake up on it’s own from sleep without any external stimuli?
There’s already a good explanation here, so I’ll tackle from another angle. Because the humans who didn’t wake up and slept all day got hunted and didn’t forage for food etc. So we evolved to wake up due to different factors that are internal. For instance, we think “night owls” evolved so that the other humans would be awake to keep an eye out while they were at their most vulnerable. This came with the benefit of the night owls also being awake while most people slept. Early humans benefitted from having a natural rhythm to their day, including best times to sleep, good times to wake up and hunt/forage, etc. This wouldn’t work if we slept at random.
There are two systems that govern sleep.
The first is sleep-wake homeostasis or also called a sleep drive. It works simply by getting more sleepy the longer you have been awake and getting less sleepy the more you have been asleep. It uses a hormone that builds up and dissipates. Caffeine works but blocks the receptors from this hormone. When babies are first born, this is the only system that is “on”.
The second system is circadian rhythm this uses cortisol and melatonin. This keeps you awake when the first system would have you sleep or asleep when the first system would have you awake.
In a typical person, they start producing melatonin when sun goes down, but it takes until 10-12, where most people probably go to be. It generally peaks between 2-4. Around 2-4 is generally when sleep-drive has worn off. At 4, the body stops producing melatonin cortisol, which starts to get made, usually peaking about 30-40 minutes after waking. So in the morning, you wake up because the sleep drive is low, melatonin is low, and cortisol is high.
Also there are sleep cycles. You go through 3 non rem and one rem stage if sleep. 1 and 2 are light stages and you do some environmental checks before going into stage 3, which is deepest sleep and is where sleep drive dissipates the most. REM happens next. Followed by stage 1. So when you get to stage 1 and you do environment checks you may notice that it’s no long night. At the beginning of the night the cycles are shorter and stage 3 is the longest. As the night goes on, the cycles are longer and rem is the longest. So, a lot of times between 4ish and 6/7 is the last longest cycle too.
If you are taking a nap in the middle of the day you usually wake up just because the sleep drive is depleted a bit. But also because you have done a cycle of sleep.
Disclaimer that Sleep is still very much a field of research and exploration in terms of the why’s and how’s of its operation, there’s a lot we still don’t know about it.
In general, sleep is largely dictated by chemical and hormonal balances within your body. The feeling of “sleepy” (distinct from physical exhaustion) is triggered by the release of relevant hormones into your brain chemistry, and likewise when your systems determine that you’ve gotten enough sleep it will shift the balance to your wake-up state.
Also bear in mind that just because you don’t have an alarm clock going off or someone shaking you, doesn’t mean that there’s no stimuli. A common trigger for wake phase is an increase of light level, whether it be the true morning sun or something else simulating it.