An attacking rook in front of its own passed pawn gets weaker and weaker the closer the pawn gets to queening because pawn keeps shortening the rook's backward aura. Such a rook belongs behind the passed pawn when it gets stronger as the pawn advances, but often this is the only way to assure that the pawn can advance. Usually this is because the attacking rook has spent so much time capturing a pawn in front that the defending rook has time to get behind the passer. In such cases, the position of the defending king becomes critical, especially when the pawn reaches the seventh rank. With White to move in the following position, the green areas are the only spots where the Black King can be in order to draw.
White can queen the pawn by moving the rook, checking the king (except for king on h6), and then playing h8=Q. The difference between a draw and a win is whether Black can capture White's last two pieces. The cluster of green squares f7, f6, g7, g6, and h7 are spots where, after White moves, the Black King can move into g7 (or h7) and eliminate the queen as soon as it appears. The cluster of two squares on a7 and b7 are places where if the rook checks on a8 or b8 respectively, the Black King simply captures the rook and then the Black Rook captures the pawn. If the king is not in contact with the 8th rank or g7, the White Rook lives long enough to protect the newly queened pawn and recaptures after h8=Q Rxh8 Rxh8. On squares such as c7, d7, and e7, the Black King is still not safe because White moves Ra8, threatening h8=Q. If Rxh7, Ra7+ skewers the king against the rook and wins the game.
A friend of mine played a game and ended up in this position:
White to move, Black is better
Black just survived a mating attack, but emerged into a rook and pawns endgame with a decent endgame advantage. His rook is actively placed near White's pawn weaknesses on a2 and c3. Black's distant a-pawn has some room to run down to a3. If White tries to stall this by playing a3 or a4, the pawn weakness on c3 falls even quicker. If the black pawn gets to a3, then Rb2 becomes a threat. Black's King is also closer to the center. Plus, Black's g-h-pawns can form an outside passer against White's lone h-pawn. At the moment, Black threatens Rb1+ and exchanging rooks. Black would have the win in the pure pawn ending because this outside passer would distract the White King while the Black King picks up c3 and d4. So those are Black's advantages.
What does White have going for him? It turns out there is one move that goes a long way toward solving his problems. 1.Rg5! hits the d-pawn which is the base of Black's central pawn chain. Black can defend with Ke6, but then White resolves one backward weakness with 2.e4! Now, White gains a dangerous protected passer at d4 and the White Rook gains a path to get behind Black's dangerous a-pawn if not capture it outright. This active plan would have gone a long way toward securing a draw. Instead, White chose a passive posting for his rook. 1.Re2
It is true that the passivity of the rook is temporary because Black can't stop e4, but one additional defect of Re2 is that Black is dangerously close to forcing the exchange of rooks. 1...a4! 2.Kg2 Kf6?!
Centralization of the king is key in endgames, but here I thought Black was better served forging ahead with 2...a3. Although Stockfish endorses this move, the win is quite difficult as both sides proceed to gobble up pawns until all that is left is Black's g- and h-pawns. 3.e4 dxe4 4.Rxe4 Rb2+ 5.Kg3 Rc2 6.d5 Rxc3+ 7.Kf2 Rc2+ 8.Ke3 Rxa2 9.d6 Rxa2 10.d7 Rh3+ 11.Ke2 Rd3 12.Rxc4 Rxc7 13.Ra4 h5 14.Rxa3 and the connected passers should win. 3.Kf3 Kf6 I thought it was futile for Black to try to prevent e4.
4.e4+ dxe4 5.Rxe4 Rb2
Here again, White faces a choice to keep his rook active or passively try to consolidate. The pure pawn endgame is not so clear for Black any more since Black has no pawn on e4. The protected passer at d4 will likely be stronger than an outside passer at g3. White is close to a draw with a variation like 6.Re5+ Kf6 7.Ra5 Rxa2 8.h4 Ra3 9.Ke4 Rxc3 10.Rxa4. Instead, White chose 6.Re2
6...a3!
White has something in that his rook cuts off the Black King from the passed d-pawn. However, Black just needs to stay in the square of the pawn and if White tries to advance it, an exchange of rooks should create a winning pawn endgame. White cannot exchange rooks on b2 as the passer is unstoppable. 7.Ke3
Since White is occupied with stopping the a-pawn from queening, Black can pursue a plan to create a second weakness. 7...g5! 8.Rf2+ Ke6 9.Rd2 If White does nothing, Black has a winning plan of advancing the g-pawn to g4, then the h-pawn to h3 and then creating an outside passer.
Here is a hard decision for Black. White is finally about to create activity for his rook with d5+ Kd6 Rd4. It would seem as if this should be prevented with Kd5, but then h3 h5 Rf2 seems to activate the rook anyway and now Black's g-h-pawns seem in danger. It turns out that the desertion of the second rank by the rook is good for Black's a-pawn such that even placing the g-pawn on the same rank where the rook will land is the strongest move for Black. 9...g4!
White has little choice but to follow through since h5 h4 h3 and g3 are coming. 10.d5+ Kd6 11.Rd4
Black has another interesting choice here: capture on a2 or h2. But then White has a choice also, capture on c4 or g4. The a-pawn is closest to queening, so trying to force the a-pawn to queen (and trying to prevent it) should make the choices easy. The game continued 11...Rxa2
White needs to make sure he can stop the a-pawn. If he captures Rxc4, there isn't enough time for the rook to come back to Rd2 or Rd1 to defend laterally. So Rxc4 commits to Ra4. Armed with the information given at the beginning of this post, you should be able to calculate a plan for Black after 12.Rxc4 and whether it succeeds. What's harder to calculate is that 12.Rxg4 is still lost, but Black has more work ahead. 12...Ra1 13.Rg2 a2 14.Re2! shielding the king from Re1+. Black's winning plan then is to advance his King to b3. White chose the worse variation 12.Rxc4
In this position, while watching the game, I hadn't appreciated that the plan starting with Ra1 was so fast. Here it is: 12...Ra1!
13.Ra4 a2
...and without a place to hide from check or a chance to get to g2 or b2, White is completely lost. Kf2 stops the check, but Rh1! Kg2 a1=Q queens the pawn or Rxa2 Rh2+ skewers the king on the rook. White's c-d-connected pawns are of no consequence if Black wins the rook. Instead, my friend made things hard on himself with 12...Kxd5?! Note here that White now has time to get his rook to e2 if necessary to stop Re1+. Exchanging pawns is good for the defender. 13.Rxg4 Rxh2 14.Ra4
Even with the reduction in pawns, the endgame is still quite interesting. Black retains the advantage of an advanced a-pawn. But he also has an unopposed distant h-pawn. The presence of this h-pawn as well as the placement of the Black King on d5 turns the Black Rook into a Super Skewer, able to operate on almost four whole ranks. Normally, Black would be content to advance a2, but his next move is both tricky and strong. 14...Rh3+!
Where can White's King go? Kf4 fails to Rh4+ skewering the Ra4. So retreat to the second rank seems necessary and Kd2 also holds the c3 pawn. 15.Kd2 Black exploits the position of the White King with 15...a2! White can't check the Black King indefinitely as it will just walk forward to b4 and stop the checks. White has little choice but to pursue the pawn with 16.Kc2
Here, my friend missed a golden opportunity to win easily. 16...Rh1!
The threat of course is a1=Q. White can prevent the new queen from living beyond a moment and White can also prevent Black from winning a clear rook. But because the exchanges happen on a1 or a2, Black's h-pawn runs free outside of the square of White's King. e.g. 17.Kb2 a1=Q+ 18.Rxa1 Rxa1 19.Kxa1 h5 and Black wins.
My friend was in time trouble and should be excused from missing some of the best variations. But the longer the game went on, the worse the time trouble. He played 16...h5?! 17.Kb2 Rh2+!
Black is still probably winning, but just barely. For one thing, White is close to a stalemate trap. 18.Ka1!? h4 19.Rg4 Through a combination of harassing checks and advancing the c-pawn, White just needs to get Black to play KxP and then the White Rook can check the king mercilessly, even giving itself away because the White King is stalemated.
Instead, White opted for some scary counterchances. 18.Kb3 h4 19.Rd4+
Black would like to keep the position under control by staying in front of White's passed c-pawn. Unfortunately, White has endless checks on the a- through d- files. For the win, Black has no choice but to move to 19...Ke5 Both sides race their pawns forward. 20.Rd1 h3 21.c4 Rg2 22.c5 h2 23.c6
Now my friend played an inexplicable move. 23...a1=Q 24.Rxa1 Afterward, he told me he thought he had a safe win with 24.Rxa1 Kd6? but then he realized that 25.Rh1 draws. I thought that the previous moves Rg2 and h2 set up 23...Rg1 24.c7 h1=Q 25.c8=Q
With the first move after queening, Black wins with 25...Qf3+ 26.Kb4 Rg4+ 27.Ka5 Qa3+ 28.Kb6 Rb4+ 29.Kc7 Rc4 The rook skewers once again, this time king onto queen. Once my friend realized 24...Kd6 draws, he went for 24...Rg1 25.c7 h1=Q 26.c8=Q
The Black Queen still moved first. With some judicious checks, he centralized his queen and won the rook. Then he weathered a bunch of checks, retreating with the king toward the relative safety of the space between friendly rook and queen. Finally, White ran out of checks and Black had a mating combination. 26...Qd5+ 27.Kb4 Qd4+ 28.Kb5 Rxa1 29.Qh8+ Kd5 30.Qd8+ Ke4 31.Qh4+ Kd3 32.Qg3+ Kc2 33.Qg2+ Kb3 34.Qf3+ Kc2 35.Qe2+ Kc3 36.Qg2 Rb1+ 37.Kc6 Rb6+ 38.Kc7 Qd6+ White resigned. After 2.5 hours for each side, Black had about 60 seconds remaining on his clock.