We'll assume that by now you spot the pin of Black’s bishop on f7 with no trouble. What can Black do about it? Kg6 is helpful because now the bishop can move, and in the meantime it is guarded as many times as it is attacked and therefore is safe. But Black can do better: he can capture the pinning piece. It’s protected, so the piece he uses will be lost; he plays 1. ...QxR and White replies 2. NxQ. But now Black’s bishop has been freed, so he can play 2. ...BxQ, winning back his queen with a rook to show for his trouble. (Note, though, that White then has 3. NxRb6, c7xN.)
As this position illustrates, sometimes a pinned piece is restrained by the pin from doing great damage—here, taking the enemy queen. In that case a big sacrifice to wipe out the pin (such as Black's QxR here) may be justified by the blow the pinned piece will be able to inflict once it is at liberty.