Crystals and Earnshaw's theorem Earnshaw's theorem states that there can be no stable equilibrium in an electrostatic field. Now consider an ion in a cubic lattice, eg, a sodium ion in NaCl. That ion is certainly in stable equilibrium, and it is acted on by the electrostatic field of all its neighbors. There must be something fundamentally quantum mechanical about the ionic bond, beyond electrostatic attraction and repulsion. Can someone explain simply what that extra ingredient is?
 A: As mentioned by @tippy2tina, the Pauli exclusion principle (a quantum phenomenon) is one reason, and the other is the discrete nature of electron states in a potential well (another quantum phenomenon). Rather than thinking about a solid, which is complicated, as yourself why a doesn’t a Hydrogen molecule collapse in on itself? It turns out that quantum mechanics allows only discrete orbitals for electron states, and the lowest energy orbital has a non-zero radius. The details are in the Schrodinger equation (I encourage you to research further, including the solved problem of the Hydrogen atom). The stability of solid crystals and the like essentially follows from there.
A: Earnshaw's theorem states:

a collection of point charges cannot be maintained in a stable stationary equilibrium configuration solely by the electrostatic interaction of the charges.

This does not apply to atoms because fundamental particles like electrons are not point charges in the sense of a classical point charge. At the quantum level particles are described by a wavefunction that is always delocalised over some region of space. You will often see electrons described as points, but this means only that they have no internal structure. To localise an electron to a point would require infinite energy so it never happens. The usual analogy is to imagine the electron as a fuzzy cloud with neither a precise position nor precisely defined edges.
Consider a hydrogen atom as a positive proton with the negative electron as a fuzzy cloud centred on the proton. The energy will be decreased if the cloud shrinks inwards because of the electrostatic attraction between the proton. However when the electron cloud shrinks its energy goes up. This is a purely quantum effect and has its origin in the uncertainty principle:
$$ \Delta x \Delta p \ge \frac{\hbar}{2} $$
When the electron cloud shrinks its position uncertainty $\Delta x$ decreases, so its momentum uncertainty $\Delta p$ increases. Since energy is related to momentum by $E = p^2/2m$ the increase in the momentum uncertainty produces an increased energy.
The net result is that if we imagine shrinking the electron cloud in towards the proton at first the energy reduces but once the uncertainty principle becomes important the energy passes through a minimum and starts rising again. You can do a rough calculation of the radius corresponding to the minimum energy, and indeed it turns out to be at one Bohr radius.
And this applies to all materials made up from atoms including the example of sodium chloride that you mentioned. The extra ingredient that means Earnshaw's does not apply is the increased energy associated with localisation of the electrons.
A: In addition to purely electromagnetic forces, ions experience a short distance repulsive force, due to the Fermi-Dirac exclusion principle.  No two electrons can occupy the same orbital and when two ions become too close the ground state orbitals overlap and the electrons are forced into higher energy orbitals, which requires energy.
