What is a passed pawn?
A passed pawn has no enemy pawn in front of it on its own file. It also has no enemy pawn on either file next to it.
Nothing can stop it except a piece. In an endgame that makes it the most valuable thing on the board.
Both sides then have the same question. Where does the rook go?
Why is the rook better behind the pawn?
Put your rook behind your passed pawn and three good things happen at once.
1. The pawn is guarded on every square it lands on. The rook never has to move again to keep protecting it.
2. The enemy rook has to stop the pawn from in front. That rook is stuck on one file and does nothing else.
3. Your rook keeps its freedom. As the pawn goes up the board, the rook has more squares behind it, not fewer.
In the first diagram White plays 1.a6 and the black rook on a7 is tied to one square. It cannot leave the a-file, so Black is really playing with one piece less.
What happens when your rook is in front?
Swap the rooks over and the same pawns are worth nothing.
Now the white rook stands on a8, in front of its own pawn. It cannot move, because the pawn behind it would fall. The pawn can only reach a7, and there it is blocked by its own rook.
Meanwhile the black rook behind the pawn is free to do whatever it likes. An extra pawn that neither piece can use is not an advantage.
Put your rook behind the enemy's passed pawn too
The rule works from both sides, and this is the half most learners forget.
If your opponent has a passed pawn, get your rook behind it rather than in front of it. From behind, your rook attacks the pawn and follows it forwards.
The opponent then has to keep a piece guarding the pawn from in front, and that piece stops being useful.
The mistake we see most often
Learners chase the enemy pawn with the rook from in front, because blocking feels safer than attacking.
It costs the game slowly. The rook sits on one square for twenty moves while the other side improves the king and wins somewhere else.
The habit to build is small. Whenever a passed pawn appears, ask one question before you move anything. Which end of that pawn is my rook on?