Electrons are the key players. Like human lovers, electrons are unpredictable, fickle, and always open to better offers. They buzz around protons in distinct orbits, each associated with a different energy level. Wherever possible, electrons head for the orbits closest to an atom’s nucleus, which require the least energy. But the number of spaces in each orbit is limited, and if no places are left in the inner orbits, they have to settle for places in an outer orbit. If that orbit has just the right number of electrons, everyone is happy.