Solids and conductivity
At long distances, the electric field from one atom polarizes another, that is distorts it slightly, inducing an electric dipole that attracts the other atom, and vice versa.
At short distances, the electron wave functions start to overlap, and the Pauli exclusion principle kicks in, and the atoms repel each other- all this seen in molecules.
If there are many atoms close to each other, and there is enough time for them to find the lowest energy state, there must always be some geometrical configuration that is most stable.