<P> In some reactions between highly reactive metals (usually from Group 1 or Group 2) and highly electronegative halogen gases, or water, the atoms can be ionized by electron transfer, a process thermodynamically understood using the Born--Haber cycle . </P> <P> Ions in ionic compounds are primarily held together by the electrostatic forces between the charge distribution of these bodies, and in particular the ionic bond resulting from the long - ranged Coulomb attraction between the net negative charge of the anions and net positive charge of the cations . There is also a small additional attractive force from van der Waals interactions which contributes only around 1--2% of the cohesive energy for small ions . When a pair of ions comes close enough for their outer electron shells (most simple ions have closed shells) to overlap, a short - ranged repulsive force occurs, due to the Pauli exclusion principle . The balance between these forces leads to a potential energy well with a minimum energy when the nuclei are separated by a specific equilibrium distance . </P> <P> If the electronic structure of the two interacting bodies is affected by the presence of one another, covalent interactions (non-ionic) also contribute to the overall energy of the compound formed . Ionic compounds are rarely purely ionic, i.e. held together only by electrostatic forces . The bonds between even the most electronegative / electropositive pairs such as those in caesium fluoride exhibit a small degree of covalency . Conversely, covalent bonds between unlike atoms often exhibit some charge separation and can be considered to have a partial ionic character . The circumstances under which a compound will have ionic or covalent character can typically be understood using Fajans' rules, which use only charges and the sizes of each ion . According to these rules, compounds with the most ionic character will have large positive ions with a low charge, bonded to a small negative ion with a high charge . More generally HSAB theory can be applied, whereby the compounds with the most ionic character are those consisting of hard acids and hard bases: small, highly charged ions with a high difference in electronegativities between the anion and cation . This difference in electronegativities means that the charge separation, and resulting dipole moment, is maintained even when the ions are in contact (the excess electrons on the anions are not transferred or polarized to neutralize the cations). </P> <P> Ions typically pack into extremely regular crystalline structures, in an arrangement that minimizes the lattice energy (maximizing attractions and minimizing repulsions). The lattice energy is the summation of the interaction of all sites with all other sites . For unpolarizable spherical ions only the charges and distances are required to determine the electrostatic interaction energy . For any particular ideal crystal structure, all distances are geometrically related to the smallest internuclear distance . So for each possible crystal structure, the total electrostatic energy can be related to the electrostatic energy of unit charges at the nearest neighbour distance by a multiplicative constant called the Madelung constant that can be efficiently computed using an Ewald sum . When a reasonable form is assumed for the additional repulsive energy, the total lattice energy can be modelled using the Born--Landé equation, the Born--Mayer equation, or in the absence of structural information, the Kapustinskii equation . </P>

Why do the ions in a lattice stay in place