Ionic bonds are chemical bonds in which we assume the electrons have fully "moved" from one element in the compound to another. This transfer of electrons from one species to another leads to ions. Elemental ions are elements with either less/more electrons that the neutral atom. Atoms that have "lost electrons" will have a positive charge and are called cations. Atoms that have gained electrons have a negative charge and are called anions. As positively and negatively charged particles are attracted to one another combinations of cations and anions form compounds that are held together by this electrostatic force. We refer to this as an ionic bond. The net effect for forming an ionic bond between two atoms is the sum of all of the "parts" of making the two ions from the elements and the energy of bringing them together. In general we can think about this as the sum of three processes.
The energy required to form the cation. This is the ionization energy for the element that is losing the electron(s).
The energy that is gained by forming the anion. This is electron affinity for the element that is gaining the electron(s).
Finally there is the energy that is gained by bringing the cation and anion together. This is called the lattice energy and is related to Coulumb's law.
Let's look at these three terms for an example compound of potassium chloride, KCl. Potassium chloride is a compound with a one to one ratio of K+ ions and Cl- ions. The energy of the formation of this bond can be estimated by looking at the three terms above.
First is the ionization energy of potassium
\[{\rm K(g) \rightarrow K^+(g)} + e^-\]
The ionization of all elements is positive (endothermic, \(+\Delta H\) ). This means we need to put this amount of energy in to form the ion. The first ionization energy of potassium is 419 kJ mol-1. Note: this is the energy to form a K+ ion in the gas phase from a K atom in the gas phase. Here energy is absorbed.
The second term is the electron affinity of chlorine.
\[{\rm Cl(g)} + e^- \rightarrow {\rm Cl^-(g)}\]
The electron affinity of chlorine is 349 kJ mol-1. This means that 349 kJ mol-1 of energy are given off by the atom as a result of the ionization. Here energy is released (exothermic, \(-\Delta H\) ).
You'll notice that the energy required to form the cation is more than the energy released upon the formation of the anion. This means forming K+ and Cl- from their gaseous atoms should be up-hill in energy. This process will require a net input of energy. However, we have left off a key piece of this process. The cation and the anion will be strongly attracted to one another. If we move them close to each other this will greatly lower their energy.
This is the third step in the process: the energy released as a result of stabilizing the ions by bringing them together. This is the energy of crystallization. Here energy is released (exothermic).
\[{\rm K^+(g) + Cl^-(g) \rightarrow KCl(s)}\]
Here we are taking the gas phase ions and bringing them together to form a crystalline solid. Now the cations are sitting in postions surrounded by anions (and vice versa). This greatly lowers their potential energy. We typically quantify this energy by the reverse reaction. How much energy does it require to transform the crystalline solid into gas phase ions? This is the lattice energy
\[ {\rm KCl(s) \rightarrow K^+(g) + Cl^-(g)}\]
The lattice energy is positive as it is an absorption of energy. It is exactly equal to but opposite in sign of the energy of crystallization. For KCl the lattice energy is 715 kJ mol-.
What happens if we put this all together? We can now judge which is lower in energy, the isolated atoms in the gas phase or the ionic compounds solid?
\[ {\rm K(g) + Cl(g) \rightarrow KCl(s)}\]
The net effect is the sum of these three terms. The energy in from forming the cation, +419 kJ mol-. The energy out from forming the anion -349 kJ mol-. And the energy out from forming the crystal lattice of -715 kJ mol-. The total effect is now easily calculated: [+419 +(-349) + (-715)] = -645 kJ mol-1. This means that the ionic solid (KCl) is 645 kJ/mol lower in energy than the same amount of the elements used to make it. You should conclude from all this that ionic compounds are generally very stable because they are at a much lower energy state than the elements that make them.