Let us examine the question by looking at a stylized version of the game that the two powers are engaged in. Country 1 moves in the first stage and may choose between nuclear weapons N or disarmament D. Country 2 in stage 2 of the game observes the choice that country 1 has made and chooses between N and D. A representative game tree of the situation is shown in the figure.
According to the payoffs shown in the figure,
country 2 likes the option N whether country 1 chooses D or N. If
country 1 chooses D, then country 2 by choosing N guarantees for itself
a very powerful position vis-a-vis country 1. If country 1 chooses N,
then country 2 would like to choose N as this allows it a credible
deterrence against a possible nuclear attack by country 1.
Knowing country 2's thinking on this issue country 1 knows that it is optimal for it to choose N. It is easy to see that the backward induction solution of this game is the following.
While the example is quite clearly highly stylized, it brings to the fore the incentives that countries have in engaging in arms races. In the game, it is clearly rational for the two countries to build up their nuclear arsenal. And left to themselves the countries would do exactly what the model predicts.
It is also clear that both countries would be better off without having to spend on an arms race, but the equilibrium solution predicts differently. This is precisely why arms races are so prevalent and why it is so difficult to persuade countries to pursue another strategy.