One way to draw a game is to manuvuer into a sitiuation where the same EXACT position is repeated three times. This is called THREE-FOLD REPITITION. It usually happens with PERPETUAL CHECK. That means one side keeps checking the other side and neither side can make progress. Sometimes, you have to be accurate, or else your opponent can escape the checks! When losing, you can use this very useful technique.
The intervening moves do not need to be the same, just the position. Part of the position is the available legal moves. For example, you can't have lost the ability to castle (by, for example, moving the rook) or losing the ability to capture a pawn en-pessant (by not doing so immediately).
This draw is not automatic, like most it must be claimed by the player who has the next move, or is about to make the drawing move. Otherwise play goes on.