Queen vs. pawn endgames are very important as they often arise in practice. Closely fought endgames can often simplify to a KPvKP endgame, where the outcome of the game depends upon which side is closer to queening. If the side that loses the race is not able to reach the 7th rank when their opponent's pawn is queened, then the Queen wins easily. However, if the pawn can make it to the 7th rank and its King can provide support, then you may find it surprising that the outcome of the game depends upon which file the pawn stands on. If the pawn is a central pawn or a knight's pawn, then the Queen can still win with the technique about to be discussed. If the pawn is a bishop's pawn or a rook's pawn, then the defender has a trick which lets him draw. Imagine the following scenario, where white has won the race to promote but black has made it to the 7th rank and is threatening to queen.
This technique can be performed even more easily with a knight's pawn. However, when the pawn stands on the c- or f- files, the defender has a trick to draw. Take a similar scenario, where white will try to employ the same technique, but fails to force the King in front of his pawn.
Black is threatening to promote, so white has no spare tempi to bring in his King. When the pawn stands on the a- or h- files, the defender has a similar trick which lets him draw. With a rook's pawn, however, the problem is not that the King cannot be forced in front of the pawn. It is that, in doing so, stalemate is threatened. Take the following scenario where the King continues to play into the corner when checked, and so white has no spare tempi to bring in his King.
If the King is checked on a rank or diagonal, then he shuffles between the b1 and b2 squares. If the Queen is brought to the b-file, then the King can simply play into the corner. The game is drawn.