For threefold repetition to apply, the positions must be identical in every respect: the same pieces must occupy the same squares, it must be the same player's turn, and castling and en passant rights must be unchanged. The repetitions do not need to occur on consecutive moves.
This rule often arises in practice through perpetual check, where one player gives an endless series of checks from which the opponent's king cannot escape. Rather than continuing the cycle indefinitely, the draw is claimed by repetition. Perpetual check is an important defensive resource when a player is losing material but can force repeated checks.
Strong players sometimes use threefold repetition strategically, choosing to repeat the position to gain time on the clock or to test whether the opponent will deviate and potentially weaken their position. Arbiters and electronic boards track position repetition automatically in tournament play.