What's the relationship between ionization energy and electron affinity? I ionization eneergy deals with losing electrons and electron affinity deals with gaining electrons, but I don't know how to explain the relationship.