When two oppositely charged particles are brought closer together under a Coulombic potential, the potential energy of the pair decreases. However, conservation of energy requires that this potential energy be converted into some other form (total energy is conserved). In a simple classical description we say that it is converted into kinetic energy, ie $$-\Delta E_{Coulomb} = \Delta E_{kin}$$ In an adiabatic setting that increase in kinetic$-\Delta E_{Coulomb} = \Delta E_{kin}$, but the total energy would amountremains constant, unless some of it is transferred to an increase in temperaturesome other body. In an isothermal setting it results in an exothermic process as the thermally excited system relaxes to the temperaturequantum mechanical description of the surroundings.
Consider first a thought experiment. If you takeatoms, electrons occupy discrete states, each state characterized by a proton and an electron with no kinetictotal electronic energy (with potential and at infinite separationkinetic contributions) and allow them to associate into a hydrogen atom, the resultingdistance distribution between electron and nucleus (unstable) atom haswhich can be used to compute an energy of 13average distance).6 eV or 1 313 kJ/mol, equivalent to a temperature Transitions can occur between states through the exchange of 105 300 K for an ideal gasdiscrete amounts of such "atoms"energy (that's an absurdly high T, but then the temperature of the sun's core is presumed to be ~15.7 million Kquanta) with other bodies. This description mixes classical and QM ideas (the temperature of
An ion formed by a gas, interconversion of potentialneutral atom and kinetican electron bound at a large separation is in a high energy state relative to the ground state, and the relative energy being nearly the ionization energy of hydrogen) as a thought experimentthe ion. The pointThis is that for a highly unstable state because the slightest perturbation can drive electron and nucleus to bindapart into an electronunbound (free) state. For the ion to settle into a lower energy (more stable) bound electronic arrangementstate, the resulting atom hascorresponding to get rid of some energya smaller average distance between electron and nucleus, which it can pass onhas to the surroundings as heat.
Consider a more practical situationrelease energy. TheIt might do this radiatively photosphere of the sun has a much lower temperature, ~6000 K, and its spectrum likens that of an ideal blackbody. There hydrogen atoms associate(emitting photons) or through collisions with electrons to form hydride ionsother atoms, with a drop in electronic energy: $$\ce{H^{\cdot} + e- -> H- +h\nu}, ~~\ \ EA =0.\pu{754 eV} $$ (note I use the opposite sign convention for EA as indissipating the OP, here positive EA is lower in energy) The energy decrease involves a transition between electronic quantum states that is accompanied by release of excess energy by the ion as lightheat. ThisAnother way of seeing this is very nicely explained in the Wikipedia. Note that the hydride ionnewly formed ion has a closed shell. The formationan excess of a closed shell is associated with a positive electron affinity EA,energy that is, hydrogenit can attract electronsgive away to formcolder atoms in order to relax into a more stable closed shell anionlower energy state.
A non-mathematical explanation for the origin of the positive EA is that QM dictates what are the most stable arrangements of electrons about nuclei, and only particular arrangements are stablepossible. It is largely a geometric problem involving a balance between electron-electron repulsions, electron-nuclear attraction, the wave nature of matter evident particularly at small scales, and odd effects such as Pauli exclusion (the impossibility of two electrons having identical properties).