Why it works?
An atom consists of a nucleus composed of protons and neutrons, surrounded by electrons. Protons and neutrons (collectively known as the nucleons) are held together by strong nuclear forces. This is a kind of short-reach force, weak in large distances but strong in distances smaller than atom nuclei. At larger distances, it dominates electrostatic forces that for example tries to repel positively charged protons.
In order to separate nucleons from nuclei, some amount of energy is needed. This energy is called nuclear binding energy. If you weigh separate nucleons, their weight will differ from the weight of the whole nucleus — the difference is exactly the nuclear binding energy (energy can be converted to mass by the famous Einstein equation E = mc2). In periodic table of elements, nuclei have different binding energy per nucleon depending on which atom they came from.
In small atoms, from hydrogen to sodium, the binding energy per nucleon increases with an increasing atomic number. This is because each additional nucleon is attracted by other nearby nucleons, and thus more tightly bound to the whole. Some atoms, such as helium4 or oxygen16, are exceptions — their nuclei are very stable because the number of protons and neutrons is so that they can be arranged in complete shells within an atomic nucleus.
With increasing atomic numbers, the region of relative stability is reached from magnesium to xenon. Binding energy remains more or less the same. This is because the nuclei become large enough to balance attractive strong nuclear forces and repellent electrostatic forces.
In elements heavier than xenon, the nucleus is large enough that strong nuclear forces can’t reach across the whole nucleus and repellent electrostatic forces became more dominant. Binding energy per nucleon decreases with increasing atomic numbers.
The point is, when you want to disassemble the nucleus of light atoms, like helium, you need to add energy. If you put two nuclei of light atoms together and manage to make a new nucleus, energy will be released. In the middle of the periodic table of elements, nothing will be gained or lost by nucleus assembling or disassembling because the difference in binding energy between those atoms is very small. In the heavier atoms, tearing apart the nucleus of heavy atoms will release energy and vice versa, assembling nucleus of a heavy atom will need some extra energy to be added.
This fact is used in energetics. Fission power plants rely on disassembling the nuclei of the uranium fissile isotope 235U and harness released energy. But fusing light atoms together will make even more energy than fission. When deuterium (hydrogen with one neutron) and tritium (hydrogen with two neutrons) are fused, this reaction releases 17.53 MeV of energy. On the contrary, fission of one uranium nucleus releases 200 MeV of energy. After recalculation, energy released per nucleon is 3.5 MeV for fusion and 0.5 MeV for fission. You can get seven times more energy from one gram of fusion fuel than from 1 gram of fission fuel. The only thing needed is to persuade atoms to fuse.