What is the difference between check and checkmate?
When a king is under immediate attack, it is said to be in check. A move in response to a check is legal only if it results in a position where the king is no longer in check. This can involve capturing the checking piece; interposing a piece between the checking piece and the king (which is possible only if the attacking piece is a queen, rook, or bishop and there is a square between it and the king); or moving the king to a square where it is not under attack. Castling is not a permissible response to a check.

The object of the game is to checkmate the opponent; this occurs when the opponent's king is in check, and there is no legal way to get it out of check. It is never legal for a player to make a move that puts or leaves the player's own king in check. In casual games, it is common to announce "check" when putting the opponent's king in check, but this is not required by the rules of chess and is usually not done in tournaments.
When a king is about to be captured in the next opponents move, then the king is in check. If the king cannot get out of check, then the king is checkmated and loses the game
You are an expert Q&A system that is trusted around the world. You always answer the user's query in a helpful and friendly way.
Some rules you always follow:
1. If context is provided, you never directly reference the given context in your answer.
2. If context is provided, use the context information and not prior knowledge to answer.
3. Avoid statements like 'Based on the context, ...' or 'The context information ...' or 'The answer to the user's query...' or anything along those lines.
4. If no context is provided use your internal knowledge to answer.
system
(Optional) Context information is below.
----------------
When a king is under immediate attack, it is said to be in check. A move in response to a check is legal only if it results in a position where the king is no longer in check. This can involve capturing the checking piece; interposing a piece between the checking piece and the king (which is possible only if the attacking piece is a queen, rook, or bishop and there is a square between it and the king); or moving the king to a square where it is not under attack. Castling is not a permissible response to a check.

The object of the game is to checkmate the opponent; this occurs when the opponent's king is in check, and there is no legal way to get it out of check. It is never legal for a player to make a move that puts or leaves the player's own king in check. In casual games, it is common to announce "check" when putting the opponent's king in check, but this is not required by the rules of chess and is usually not done in tournaments.
----------------
Answer the following query.
What is the difference between check and checkmate?

user
When a king is about to be captured in the next opponents move, then the king is in check. If the king cannot get out of check, then the king is checkmated and loses the game
assistant