An atom of sodium has one 3s electron outside a closed shell, and it takes 5.14 eV of energy to remove that electron. The chlorine lacks one electron to fill a shell, and releases 3.62 eV when it acquires that electron.
This means that it takes 1.52 eV of energy to donate one of the sodium electrons to chlorine when they are far apart.
When the neutral Na and Cl pairs come close to each other, potential energy is released, but why is it now energetically more favorable when Na transfers its electrons with this released energy to the Cl? Wouldn't the potential energy be even more negative if they came closer and didn't transfer anything? The atoms do not "know" beforehand that if they transfer an electron they can now come even closer together and even more potential energy is released, so does it depend on the coincidence that both neutrals come so close at the beginning that these 1.52 eV lead to the electrons passing over? Is this explained by statistical thermodynamics (so many possibilities happen randomly in some kind of event space?) and can someone recommend me a good book about it? And when it is said through the loss of potential energy this 1.52eV can be produced, in what form does this potential energy go, heat? Somehow this kind of released energy must then ensure that the minimum energy for removing the electron is still applied and it must then also remain at this energy level at least, so that the electron also does not go back again.
It is always said that at the beginning energy is needed, but at the end more is released which then compensates everything again, does this initial energy then really only come from the sodium and chlorine accidentally colliding so close that the potential energy falls and thus the electron passes over and then the rest runs off?
Finally, is the room temperature already sufficient for $\ce{Na + Cl -> Na+ + Cl- }$?