Why is better for white to move Rxa7 instead of Nxd3? I am trying to analyze the below middle game with White to move. I played Nxd3 to capture Black's queen. However, the engine analysis says that a better move is Rxa7.
[FEN &quot;r5k1/r4pp1/3P3p/8/8/1p1qP1P1/1Np2P1P/R1R3K1 w - - 0 1&quot;]

If I stick to my play, I expect the these moves-1. Nxd3 Rxa1 2. Rxa1 Rxa1.
White would gain a queen and a rook, while Black will gain two rooks.
If I follow the engines suggestion, I expect the these moves- 1. Rxa7 Qd5 2. Rxa8 Qxa8. White would gain two rooks, while Black will gain one rook.
From the perspective of white, wouldn't it be better to capture the Black queen? Black certainly seems to have a stronger position, but letting the Black queen go seems counterintuitive to me. I am certainly missing something and would appreciate your insights here.
Both rooks control White's back rank. If they are removed through:


Nxd3 Rxa1
Rxa1 Rxa1


Then both pawns cannot be stopped at the same time by the single knight, guaranteeing Black a Queen-Rook endgame. Let's assume White plays Kg2 next:


Kg2 c1=Q
Nxc1 Rxc1


Then the pawn at b3 will surely become a Queen. A worse move but still wins:


Kg2 b2
Nxb2 c1=Q


Because Black still has a Queen and the rook versus White's only minor piece, the Knight.



We also should notice White's passed pawn at d6. So even with d7:


d7 c1=Q+
Nxc1 Rxc1+
Kg2 Rd1


Rd1 prevents White from promoting:


d8=Q+ Rxd8