Understanding the basis of energy differences

For most processes there is a difference in energy between reactants and products.  Although the basis of this difference  is too complicated to understand easily for many processes, some that are easily understood are highlighted below.

In general when considering particles that are attracted to one another, separating them requires input of energy, bringing them closer together releases energy.
 
Disrupting interparticle forces requires energy.
When considering the same substance, the attractive forces between particles that comprise it are stronger in the solid than in the liquid than in the gas.  This because the particles are closest in the solid and farthest apart in the gas.

Breaking chemical bonds requires energy
The atoms involved in a chemical bond are attracted to one another because the electrons in the bond are attracted to both nuclei.

Separation of charge requires energy.
Removal of an electron from a gas phase atom requires energy.  This process is referred to as ionisation.

Neutralizing charge releases energy.
Bringing gas phase ions of opposite charge into a lattice where each ion is surrounded by ions of opposite charge releases energy.

Dispersing charge over a bigger volume releases energy
In hydrated cations the oxygen atoms in the water molecules are attracted to the cation.  This disperses some of the positive charge to the water molecules.

In hydrated anions, the hydrogen atoms in water molecules are attracted to the anion, and this disperses some of the negative charge.