Why does chess end in a draw?

Why does chess end in a draw? A draw by stalemate happens when the player who needs to move has no legal moves and his king is not in check (otherwise, that would be a checkmate!). For a stalemate to happen, the move that produced the position has to be legal.

A draw by stalemate happens when the player who needs to move has no legal moves and his king is not in check (otherwise, that would be a checkmate!). For a stalemate to happen, the move that produced the position has to be legal.