The stability of each electron state in an atom is described by the quantum theory of the atom, which shows that close approach of an electron to the nucleus necessarily increases the electron's kinetic energy, an application of the uncertainty principle of Heisenberg. However, stability of large systems with many electrons and many nucleons is a different question, and requires the Pauli exclusion principle.