Relativity in brief... or in detail..
E = mc2 and binding energies in the nucleus (and in molecules.)This famous equation describes how mass m can be turned into energy E. Conversely, when we do work on something, we give it energy, so we can increase its mass by an amount Δm = E/c2. (The symbol Δ, pronounced 'delta', means 'the change in'.)
First, something about stability. For macroscopic objects, a system is stable if it requires energy to put it into another state. For example, a stick is stable lying on the ground. To lift up one end or the other, we have to give it energy, to do work on it. Conversely, if it is standing vertically on one end it is unstable: it can lose energy by falling over. (On the microscopic scale, the conditions of stability are different because of thermal motion and sometimes quantum effects.)
Let's start with the atomic nucleus. Happily for us, most of them are stable - they don't disintegrate spontaneously. (And, also happily for us, some of them do - the Earth would be a very different place without radioactivity.) For example, a deuterium nucleus (which is called a deuteron) has just two components, a neutron (symbol n) and a proton (symbol p). When we add an electron (symbol e) to the deuterium nucleus, we get an atom of deuterium (symbol D).
If we 'pull apart' a deuterium nucleus, we require energy Ed. We call this the binding energy of deuterium. When we supply this energy, the mass is increased by Δm = Ed/c2. Conversely, when two particles that attract each other come together, they lose energy and their mass decreases.
Now we've exaggerated in this animation. Let's do the accounting. A convenient unit used for atomic masses is called simply the atomic mass unit (symbol u), which is one twelfth of the mass of an atom of the most prevalent isotope of carbon. The masses in which we are interested are:
mn = 1.0087 u = 1.68 x 10-27 kg
md = 2.0141 u = 3.34 x 10-27 kg
me = 0.00055 u = 3.34 x 10-31 kg
So, if a nucleus is stable, its mass is less than the sum of the masses of its components, and the difference is called the binding E = Δmc2.
Now relativity is not confined to the nucleus. An oxygen molecule is also stable, which is another way of saying that it takes energy E to pull two oxygen atoms apart. So you could think of the animation as representing a stable molecule. However, the binding energies of molecules are much less than those of nuclei, and so the masses involved are smaller. A typical chemical reaction might involve a nett energy of 30 kJ per mole, or 5 x 10-20 J per molecule. So the change in mass is 5 x 10-37 kg, which is only .0001% of the mass of an electron.
For more discussion, see this link. And to see why the neutron and proton attract, see Why there would be no chemistry without relativity.