I was going through my chemistry textbook (Chemistry, 10th Ed. by Raymond Chang) when I encountered this explanation of lattice energy.
9.3 Lattice Energy of Ionic Compounds
We can predict which elements are likely to form ionic compounds based on ionization energy and electron affinity, but how do we evaluate the stability of on ionic compound? Ionization energy and electron affinity are defined for processes occurring in the gas phase, but at 1 atm and 25 °C all ionic compounds are solids. The solid state is a very different environment because each cation in a solid is surrounded by a specific number of anions, and vice versa. Thus, the overall stability of a solid ionic compound depends on the interactions of all these ions and not merely on the interaction of a single cation with a single anion. A quantitative measure of the stability of any ionic solid is its lattice energy, defined as the energy required to completely separate one mole of a solid ionic compound into gaseous ions (see Section 6.7).
In this text, it seems like the writer is implying that for an ion pair in the gaseous state, ionisation energy (IE) and electron affinity (EA) can be used to measure it's stability. But even an ion pair in the gaseous state is held by an electrostatic force that gives it more stability, so more energy will be needed to separate the ion pair and that energy would be more than IE and EA. What does the writer mean, and what is the correct definition of lattice energy?