That is a battery, and the whole point is that they add up. Every square down the d-file is now attacked twice.
A square defended once holds against one attacker. Bring a second attacker and it falls. That is the entire arithmetic of an attack.
And the order matters enormously. Here the queen on d1 is behind and the rook on d3 is in front, which is the right way round.
Because the piece in front makes contact first. If the queen were in front, she would get traded for something cheaper and the battery would be gone.
So the rule is short. The queen is the heaviest gun, and heavy guns fire from the back.
And it does not stop at two. Two rooks with the queen behind them has a name: Alekhine's gun.
Three attackers on one file, and the queen still safely at the back where nothing can trade with her.
Two of your pieces, on one line, with nothing standing between them. That is all a battery is.
The rook on d3 and the queen on d1 are both on the d-file, one directly behind the other.