Stalemate is a situation in chess whereby one player has no legal moves but is not in check (that is, his king is not attacked, but all his moves would place it under attack). Stalemate ends the game, with the result a draw. The term has since come to mean any situation where two sides have no "safe" courses of action, for instance, the position of the United States and Soviet Union during the Cold War when neither side could build defensive systems for fear of a pre-emptive attack.
With black to move, each of the four black kings shown to the right is stalemated. Stalemate is an important factor in the endgame - the set-up in the top-right of this diagram, for example, quite frequently occurs in play, and the position in the bottom-left is an example of a pawn being worth as much as a queen (even if it were white's move, there is no way to avoid this stalemate without allowing black to promote his pawn). Stalemates of this sort can often save a player from losing an apparently hopeless position.
Stalemate can occur with more pieces on the board as well. The position to the right occurred in the game Gelfand - Kramnik, FIDE Candidates match, game 6, Sanghi Nagar 1994. Kramnik (black) is to move. He is two pawns down and on the defensive - he would be very happy with a draw. He played 67...Qc1! (see algebraic notation). Now, if white takes black's undefended rook with 68.Qxd8 black has a stalemate defence in 68...Qh1+ 69.Kg3 Qxf3+ 70.Kh4 (70.Kxf3 is stalemate) Qxg4+, forcing White to take the queen, so bringing about stalemate (in the actual game, Gelfand played 68.d5 instead, but could still only draw).
A piece which sacrifices itself in this way in order to bring about stalemate is sometimes termed a desperado piece. There are many examples of draws being saved in this way.
In endgame studies, the idea of stalemate very frequently occurs, and in chess problems there is sometimes a stipulation for "white to move and stalemate black in n moves" (rather than the more common "white to move and checkmate black in n moves"). There have also been attempts at constructing the shortest possible game to end in stalemate: Sam Loyd devised a game which ended in stalemate after just ten moves (1.e3 a5 2.Qh5 Ra6 3.Qxa5 h5 4.Qxc7 Rah6 5.h4 f6 6.Qxd7+ Kf7 7.Qxb7 Qe3 8.Qxb8 Qh7 9.Qxc8 Kg6 10.Qe6).
The stalemate rule has a somewhat convoluted history. In the forerunners to modern chess, such as shatranj, stalemate was a win for the side administering it, and this rule persisted for a while in chess, although when playing for money, a win by stalemate sometimes only won half the stake. According to H. J. R. Murray's A History of Chess (Oxford University Press, 1913), the rule for a time in England was that stalemate was a loss for the player administering it. It was not until the 19th century that the modern rule that stalemate is a draw was universally adopted.
"Stalemate" is used colloquially as a figurative term for a situation that results in a deadlock or standoff, where neither party is willing to either abandon their position or hazard direct conflict. In this figurative sense, zugzwang might be a better metaphor.