In King and Pawn endgames the King plays the part of both the attacker and defender. This endgame principle looks at both of these aspects. The King has to both attack the Pawn whilst defending the Pawn's promotion square.
In this example, the Pawn is advanced on the f5 square, but cannot be protected by the White King. The Pawn has to try and advance to f6, f7 and f8 to promote. However, the Pawn the can be caught by the Black King.
To tell whether the King is close enough to the Pawn to catch it before it promotes we have two choices. One way, is that we can count the number of squares and work out the possible variations. For example, the Pawn takes 3 moves to promote (on the f8 square). The King also needs at least 3 moves to reach the promotion square. In this case we can see the King is quick enough to catch the Pawn before it promotes. However, in a more complicated position with numerous pawns counting squares can take value time and lead to mistakes.
A quicker way to check whether the King is close enough to the Pawn is to draw a line from a Pawn to the promotion square. Use this line as one side of a square, which must be drawn towards the side of the board that is furthest away from the Pawn. If the King is inside the drawn square he is close enough to the Pawn to capture the Pawn. This is shown below.
Note that if the Pawn advances to f6 the Black King must go to either d6 or d7 to remain inside the square, which will now be a 3 by 3 square.
If the Black King was on b4, in this example, he would be outside the square. Here, with the Black King on b4 and White Pawn on f5 whoever moves is important. If White was to move, there would be a win for White, if Black was to move then after bringing his King to c5 (inside the square) a draw is possible.
This principle and the understanding of the square rule becomes extremely important when examining endgames where Pawns are used as decoys or sacrificed, so that other pawns can promote.