Sleep isn't uniform. In the second half of the night, deep sleep thins out and REM predominates, so the waking threshold is naturally lower. Everyone wakes briefly several times — the difference is what happens in the next thirty seconds.
Cortisol begins rising in the hours before waking, as part of the normal circadian rhythm. In an already activated system, that rise is enough to cross the threshold. You wake, and the mind switches on immediately onto the most loaded subject — money, work, an unresolved conversation.
The second layer is learned. After a few weeks, the body associates the bed with alertness, and the anticipation ("I'll wake up again") becomes a trigger in itself. This is where insomnia turns into a problem separate from whatever produced it.