This post describes sennichite. Sennichite is one of the shogi rules.
What is Sennichite
Consider the case as shown in the lower figure. A player on this side is trying to capture the opponent's gold general with the rook.
Then, consider the case where the opponent moves the gold general not to be capture as shown in the lower figure.
Then, the player moves the rook to capture the gold general as shown in the lower figure.
Moreover, the opponent moves the gold general to avoid capture as shown in the lower figure.
Furthermore, the player moves the rook to capture the gold general as shown in the lower figure.
Did you notice that the situation in Fig 1 is the same as the situation in Fig 5? The lower figure shows the situation in Fig 1 to Fig 5.
Repeating the same game position is called "sennichite (千日手)." Sennichite means "moves for a thousand days" in Japanese. To say precisely, sennichite is repeating the same situation four times. (It does not matter how to move pieces to the same situation.)
The Case Where Sennichite Occurs
Basically, the Game Ends in a Draw
If sennichite occurs, the game ends in a draw basically.
Perpetual Check is an Illegal Move
For example, consider the case where sennichite occurs as shown in the lower figure.
In this situation, one player checks the opponent's king continuously. Then, the checking player loses. In shogi, a perpetual check is an illegal move.