A pin is an attack on a piece that has a more valuable piece of the same side behind it on the same line. If the piece in front moves away, the one behind it can be captured. When the piece behind is the king, the rules do not allow the piece in front to move off the line at all. Only bishops, rooks and queens can pin, because only they attack along a line.