Pinned pieces can still protect another piece.
Weird mate
The rules of chess currently do not allow a king to be captured (in other words, games end in stalemate or checkmate, or even other situations like resignations).
.
-------------------------------------------
.
However, let's pretend for a moment that the kings could be captured, such that the objective of the game is to capture the opponent's king.
.
The queen on g2 is checking the king on h1. Who is defending it? The rook on g6, which is itself pinned to the h7 king due to the queen on f5.
.
Let's think for a moment. What are pins? Pins are situations in which a piece is "temporarily glued" to a square and cannot move in the pinned direction because the removal of the pinned piece from the pinned direction results in a capture of the king (thus ending the game).
.
However, bear in mind that "whoever gets the king captured first loses". So, if the White king captures the queen on g2, the rook captures the king on g2 - and that king is gone before the king on h7 can get captured! Now you can see why capturing on g2 is not allowed.
.
------------------------------------------------------------
.
In chess, we are not allowed to bring our king to an attacked square, regardless of the circumstances.
Why is it mate if black rook cannot recapture my king? I think that i cannot caputre and be checked but in reality my king is not in danger.