Both of White’s bishops are trained on the Black king’s position; so is White's rook on g3. His queen isn’t quite there yet, but it easily enough could be moved into position to attack with support from one of those other pieces. A natural idea would be to move the queen so it can attack h7; if it landed there with support from the bishop on d3, it would mate. The problem is Black’s knight on f6, which guards both the square where the White queen wants to go first (h5) and the square where the queen wants to end up (h7)—which illustrates why f6 is a great defensive position for a Black knight.
But White has a way to deal with this. It is suggested by the position of his other bishop on e5. If a nettlesome piece has a bishop aimed at it and the king is on the same diagonal, the position cries out for a pin. Be methodical in asking what prevents the pin from existing now. The answer, of course, is the pawn on g7. In effect there are too many pieces on the pinning line. Earlier we studied ways of overcoming this type of obstacle: take the pawn, causing a recapture that consolidates the enemy’s position. Thus White plays Rxg7. If Black replies with KxR, now the knight on f6 is pinned. All the squares it protected—g4, h5, and h7—are now vulnerable, so White starts by putting his queen on the first of them: Qg4+. Since it’s a check, the response Kh8 is forced (if Black moves his king to h6 instead, White mates with Qg5). Now White moves the queen to h5, again loose because the knight is pinned. Mate follows no matter what Black does; he has a number of checks he can give to stall for time, but none of them pan out. Eventually White will either play Qxh7# or (if Black moves his king to g8) BxN, then Qxh7#, or some other accumulation of force against the king’s corner.
The important lesson is to observe the defensive function a knight positioned like Black’s can serve, and to see how pinning it can radically reduce the security of his king by opening up key squares for hostile occupation.
It is impossible with a handful of examples to suggest all the different ways that a pin can be used to enable a mating attack, but from these studies you can take away a few frequently useful ideas. Once a piece or pawn is pinned, any squares it formerly guarded become more vulnerable and often loose. It helps to imagine placing attackers on those squares to see what then becomes possible. Pinned pawns and pieces also become incapable of interposing themselves between an attacker and your queen. This can be important when trying an attack on the back rank, where interpositions are a common form of defense; it also may be useful in attacking along diagonals or other lines, since interpositions there—especially by pawns stepping forward in front of the king—often are one way for the enemy to cut off an attack by a bishop or other piece.