Why did the US and USSR have tens of thousands of nuclear weapons when only a few hundred would’ve been enough to destroy the other country?

Now, let’s assume the Soviets fired first, aiming to take out all of our nuclear weapons. Nuke the airfields, nuke the silos, nuke the army bases, naval bases, surface fleets, centrifuges, everything. They’re dropping 6 nukes for every 1 target in your country too. If you’re firing first, do you really want your enemy to be able to fire back at all? Of course not. If the Soviets do it right, they should be able to take out, say, 90% of the US nuclear stockpile before it can be used. This is bad, because then the US is out of the fight.

So now the US needs to ensure that 10% of its nuclear stockpile is >1,800 in order to have a chance of retaliating against the Soviets if they fired first.