Before the invention of workable firearms, around the fourteenth or fifteenth century (depending on who you ask, and your definition of "workable"), the technology of war had actually changed very little in more than five thousand years. Swords, bows, shields, horses, catapults, and fortresses were as familiar to the Babylonians as they were to the Hospitalier knights five thousand years later. Because everyone made and used the same weapons, war ended up being more about how badly you wanted to win. Tremendous instability was the natural result.
No sooner would a group of people finally manage to get it together with running water and toilets than a group of nomads would come sweeping out of the steppes of Asia and wreck it all. This happened time and time again throughout history. The nomads would win because surviving on the steppes of Asia made you one mean, tough sonofabitch. You had to already own your own horse, sword, and bow, and be damned good with them, otherwise you'd starve, and of course the people you were looking to give an ass-whupping to weren't any better equipped than you were.
Hundreds, sometimes thousands of years of cultural effort would inevitably end up padding the ass of some hairy goatherd who'd managed to convince his buddies a holiday sweeping through Europe and the Middle East would be a lot more fun than drinking fermented horse milk. And the people left behind would have to start all over again with less than nothing, because the nomads would've made damned sure anyone who even looked smarter than they were, i.e. all the elders and anyone who knew how anything worked, would have their heads used as polo balls on the way home. Progress smashed and forgotten is no progress at all.
The invention of the firearm changed this equation in a hurry. Unlike swords and bows, you don't have to practice all day, every day, to be good with a gun. This made it easier, faster, and cheaper to form an effective fighting force. Cannons are only loaded with cannonballs when you want to knock down a building. Fill the same cannon with chain, glass, and rocks and you have one helluva lawnmower at your disposal. As the saying goes, bringing a knife to a gunfight is usually not the way to get what you want.
It wasn't just that having a gun made it harder for a nomad to separate your head from your shoulders. A gun isn't that much more complicated than a sword, especially if you already know how they're made. But it took a lot of infrastructure to make a lot of guns in a hurry. You've got to have forges, mills, chemical factories, and the kind of people that know how to run them, to do it. None of that stuff is anything you can pack on a horse, and so the balance swung in the favor of cities and civilizations capable of maintaining these things. Getting those capabilities changed you into one of the civilized peoples, and suddenly it was a lot more fun to make money and war was something that would only break your hard-won stuff.
Of course the civilized world found it had traded one kind of instability for another. The requirements of modern weaponry caused an unprecedented amount of power to be coalesced into the hands of just a few people. Nations flow from guns as cities flow from plows. A knight can afford to make his own swords, but only a king can get enough cash to make a cannon.
It was all too easy for an individual, or a few individuals, to use this power to try and take over the world. As firearms became more effective by orders of magnitude, especially after the industrial revolution, the world would be a much more dangerous place every time some maniac managed to claw his way to the top of one of these nations.
The way you win wars is you kill people and break stuff until the other guy can't fight any more. But industrialization made it possible to build stuff faster and faster. Each leap in technology meant it took fewer and fewer people to actually fight the war. As a defender, you had the problem of simply not being able to kill enough people and break enough stuff fast enough to make these maniacs think twice about rolling into your country with tanks. It was a risk they always felt they could take.
Enter the nuclear weapon. What is not widely known is thermonuclear devices (hydrogen bombs) have basically unlimited destructive power. Once you learn how to make one, it's almost as easy to come up with a planet buster as it is to come up with a city buster.
Now not only can you wipe out the factories that drive the maniac's war machine, you can wipe out the city that contains it with a single weapon. Mount a few dozen on missiles and you have the capability of destroying an entire country and there's nothing the other guy can do to stop you. All the tanks in the world won't do your fevered dreams of world conquest any good if the decadent, soft, patronizing peoples you are out to bring order and justice to can wipe you, your army, and your nation off the face of the earth in a matter of seconds.
Of course, now instead of maniac nomads trying to get guns we have maniac national leaders trying to get H-bombs. On the face of it, we've traded the sort of instability that wipes out nations for the sort of instability that wipes out the planet. Not much of a trade. But, as with firearms, there are some natural brakes that keep Armageddon from happening.
Building an H-bomb is hard. It's not something you can figure out just by going to a library. Nations that already know how to make them keep the secret very well. And the kind of government that puts a maniac in charge and keeps him there is not the kind of government that fosters the scientists and engineers you need to figure it out on your own. You need independent minds to do physics and engineering, and people that have independent thoughts are to dictators what guns are to drunk rednecks.
And even if you can find people greedy, vain, or shortsighted enough to tell you how to do it, it's still really f'ing hard to put the thing together. Entire industries have to be created. Big factories have to be built. Exotic materials have to be acquired. None of this can be done with any secrecy in an era of spy satellites, and the civilized world has proven itself willing and able to use any means necessary to stop their development once they are aware of it.
More importantly, as with guns before them, getting the stuff together to actually build these bombs has an annoying tendency to turn you into the kind of society that won't use them. Countries are made up of people. All these factories give people jobs, and jobs give them money, and money wants to be spent. Enough stuff is acquired that now the entire people have something to lose. From there it's just a short hop to revolution and democracy. And modern democracies don't start wars.
It's still dangerous, very dangerous. There are something like thirty thousand nuclear bombs in the US and Russian arsenals, so a maniac has an alarmingly good chance of just buying a pre-built bomb and sailing it up someone's harbor. But the development of these technologies and these devices, long thought to represent the worst of humanity's most evil intentions, will ultimately prove to be one of its saving graces.