>>12691583It looks like all the other answers are esssentially wrong or useless.
The situation looks even worse when you consider that a moving electric charge emits electromagnetic radiation, so you would expect the atom to go lower and lower in terms of energy.
Luckily this was resolved in the early 20th century by Niels Bohr. He essentially guessed that the energy of the electron was "quantized"/discretized in his model, which ended up being correct. I think one of the first things Schrodinger did with his eponymous wave equation was check that it predicted discrete energies for the hydrogen atom, which it did.
That atoms are "stable" in this sense is the main thing quantum theory did back when it was developing in the early 20th century. Indeed, a lot of the experimental information that confirms quantum mechanics comes from spectroscopy, specifically on the hydrogen atom. Later in the 20th century, Freeman Dyson used the then-polished framework of quantum theory to prove that atoms and collections of them are stable when interacting under the electromagnetic force. Elliot Lieb and Walter Thirring then sharpened his work, I'm pretty sure.