Here is a more advanced study that combines the pin with a discovered attack and shows how a pin can be used to immobilize the defender of a square you would like to have. The d-file should be an attention-grabber—the collection of pieces lined up there, and the kernel of a discovery in particular (White's knight masks his queen; he would be poised to play QxQ if the knight were out of the way). The trouble is that if White plays, say, Nxc6+, Black can both erase the threat to his king and move his queen out of trouble with QxN. It would be different if the pawn on d6 were out of the way, for then Nxc6 would create a pin as well as a discovered attack and prevent the queen from doing any defensive work. This is the value of studying the whole d-file, not just individual pieces in isolation: you then see that Black has his king at one end of it, and this suggests the possibility of the pin.
So how can the d6 pawn be removed? The first thought when an enemy pawn needs to be moved is to take something it protects, of course, but here it protects nothing—no pieces, at any rate. There remains a second method for White to consider, though, which consists of putting a piece en prise to the pawn and inviting it to capture. This naturally is most effective where the piece imposes a threat at the same time. White thus plays Re5, sticking his rook next to Black’s queen and threatening to capture it. If Black plays d6xR, White’s discovered attack—Nxc6—now works because of the pin. Black then has no choice but to move his king, after which White has QxQ. Black can also reply to Re5 with QxR; but then you examine the resulting board and see that Nxc6+ still works, not as a discovered attack but as a knight fork. White has NxQ a move later, and after the recapture ends up with a queen and a pawn in return for his knight and rook. The two passed pawns he has left on the queenside ensure victory.
Notice that all this works only because Black has such a limited range of responses to Re5. Although Black’s queen is in the middle of the board, its position is quite cramped; there are no safe squares it can reach once White’s rook is on e5. But if the pawn on f7 weren’t on the board, Black would be able to evacuate his queen to g8 and White’s plans would be foiled (though Nxc6+ still would win a pawn).
A collection of pieces of the sort we see on the d-file here often will give rise to more than one tactical possibility, especially when the king lies at one end of it. In this case a discovered attack, a pin, and a knight fork all are among the ingredients of the winning idea.