Making the Japanese believe that we would keep dropping nukes until they either surrendered or ceased to exist is what finally ended the war.
Yes. They had no idea that it would take many months to re-stock. But they knew that we would scale production to unimaginable levels, eventually.
So much for fighting to the death.
Plus these weapons proved that war, between large nations, is obsolete.
Death from war has basically disappeared and we are fortunate to be born (most of us) in this era.
We had a total of three nukes, all different designs. The first one we set off to test. Until we did, we had no idea whether or not any would work. The next two we dropped on Japan. We dropped the second nuke on Japan a week after the first because they refused to surrender after we dropped the first one.
Imagine how history would be different if any one of the three nukes had failed to go off.