Consider a simple Helium 4 nucleus (which is relatively strongly bound). If I want to separate the two protons and two neutrons of this nucleus, I have to pull them apart, overcoming the nuclear force holding them together. Doing this, even after accounting for the electrostatic repulsion between the protons, requires that I input energy, because the nucleons are strongly bound. If I had to input energy to separate the nucleons within the nucleus, and E = mc2 , then by breaking apart the nucleus I increased the mass of the system. In other words, the mass of the nucleus is less than the mass of the sum of its parts on their own. The difference between those is called the binding energy, or mass defect. This value is usually taken to be negative because the bound nucleus has less energy than the separated nucleons, so if we find the energy of the nucleus E = ∑mc2 where ∑ represents the sum over the masses of all the constituents of the nucleus, and we add the negative binding energy, it will appropriately result in a smaller amount of energy.
Now, if I do the reverse of the above scenario, and bring two protons and two neutrons together to form a Helium 4 nucleus, I went from four separate nucleons to one bound nucleus; the bound nucleus has less mass, and that amount of energy must have gone somewhere! It's the energy released by the reaction.