Not every chess game ends with a winner or a loser. There is a third result that is a very important part of the game of chess - the draw. In chess, a very small advantage isn't always enough to claim victory; the existence of the draw means that a player who is in trouble has resources to attempt to escape without a loss, which adds a lot of strategic depth to chess.
There are several different ways in which a chess game might end in a draw.
I've outlined several of them below.
Draw by Agreement
One simple way for a chess game to end is by having both players agree that the game should be a draw. This most commonly occurs when both players realize that neither has any winning chances, barring a very unlikely error from one side or the other. Of course, what qualifies as an unlikely error varies depending on the strength of the players; this makes draws by agreement much more common at the highest levels of chess.
An agreed draw can also be used strategically in tournament play. If a player can advance or win a prize with a draw, they might offer a draw even when they have a very advantageous position, simply to eliminate any risk of losing the game. If both players would find a draw satisfactory, a draw might even be agreed early in the game, without much of a fight. However, it is against the rules of chess to agree to a draw before a game is played.
Stalemate occurs when a player is not in check, but has no legal moves to make. This often occurs in games between beginners; in such games, one player will often end up way ahead in material, but not understand basic checkmating techniques. Often, this will result in a stalemate, as the stronger side will fail to find a checkmate, but instead trap the king without actually putting it into check.
Stalemates are definitely more common among beginners than in games between strong players, but they're certainly not unheard of even in high level chess. Tactics that can force a stalemate are sometimes a saving resource for a player who appears to be losing.
If the same position is reached with the same player to move three times during a game, either player may immediately claim a draw. The procedure for claiming this draw varies somewhat between rule sets, but the rule itself is fairly standard across the board. This rule exists to stop games in which both sides are simply repeating moves.
It's worth noting that there's no actual rule that allows players to claim a draw by perpetual check. However, the threefold repetition rule (along with the next type of draw) covers this eventuality; if one player is landing checks again and again without any way for their opponent to escape, they will eventually repeat the same position three times, forcing a draw.
The Fifty-Move Rule
The fifty move rule is one of the least understood rules in chess. The rule essentially states that if no progress is made after fifty moves by both players, the game is declared a draw. Progress is defined by the capture or any piece, or the movement of a pawn. If fifty moves by each player are made without either of these events occurring, either played may claim a draw.
Insufficient Mating Material
If neither player has enough material remaining to checkmate the other, then the game is immediately a draw. Examples of insufficient mating material include a single bishop or a single knight. In some rule sets, this rule cannot be invoked unless it is literally impossible for the opponent to be mated after any sequence of legal moves; under those rules, two knights do count as mating material, as do many other positions where one side could possibly maneuver themselves into a checkmate.
Efforts to Reform Draw Rules
Many players, fans, and chess officials have attempted to find ways to reduce the number of draws in chess - often with the goal of making chess more appealing to spectators. One solution has been to reduce the scoring incentive of draws. For instance, some tournaments use "football" scoring for their standings; while players normally receive one point for a win and a half-point for a draw, these tournaments award three points for a win and one point for a draw.
Most other efforts have been aimed primarily at reducing the frequency of agreed draws, particularly at higher levels of the game. Some tournaments use rules in which players are not allowed to agree to draws before a certain point in the game, such as the 30th move. Another suggestion has been to either remove the draw offer entirely, or to require all draw offers to go through a tournament director or arbiter, who would be empowered to require the players to continue playing if he felt there was any life left in the position.