When the king cannot stay in front of the pawn, it goes to the short side so the rook has the long side for checks. Keep at least three files between rook and king so the checks cannot be approached.
Black's king has been pushed to the side of the pawn. It went to the short side (f, g and h files, three files), leaving the a-, b-, c- and d-files for the rook. That division of labour is the whole idea: the king occupies the side with less room, the rook uses the side with more room to check from a distance.