Stalemate is a draw and it is when one player has no legal moves period, but their king is not in check.
Why Is This Checkmate Instead of Stalemate?

Stalemate is a draw and it is when one player has no legal moves period, but their king is not in check.

That being said, in the second scenario, if black still had an a pawn (we’ll say on the 5th rank) he wouldn’t be in stalemate because his king isn’t in check and he still has a legal move. It’s sometimes useful to leave a non advanced pawn of the opposite color for you opponent which can be useful in some checkmating patterns
Hey, I have a quick question.
Why is this situation end up at "Checkmate" instead of "Stalemate"?
Cause I think the black have no legal way to move.
I'm a beginner at chess so sorry for this stupid question.
Thanks for helping~