Ionization energy is the energy required to remove an electron from an atom. Meanwhile, Electron affinity is the energy required to add an electron to an atom. So we can see that the two are opposite variables. However, they both refers to general attraction of an atom for “electron”.