Most pilots, unlike you apparently, are not superhumans. Tiredness and fatigue happen and not all carriers do allow blame free fatigue calls, some routinely roster in extremely fatigue inducing ways and of course the result is obvious.
Combine that with routine use of controlled rest on the flight deck, which is actually meant as an emergency procedure to regain enough alertness for a safe landing, and you habe a recipe for both falling asleep. Especially at night and while the operating environment is fairly quiet (and without CPDLC which is a nice alarm by itself).
And on most short to medium range flights we do not have the luxury of a third or fourth pilot o cover for us while we rest or even sleep.