The principle is with nuclear reactors today they use fission that is used today produces energy by splitting atoms up this reaction produces energy that is used to heat water that is then used to move turbines and create electricity. Fusion produces this energy differently and could be unending because the the way fusion works it takes much less material to produce nearly unlimited amounts of energy many orders of many magnitude greater then the very dated fission.
Fusion is what powers the sun. Atoms of Tritium and Deuterium (isotopes of hydrogen, Hydrogen-3 and Hydrogen-2, respectively) unite under extreme pressure and temperature to produce a neutron and a helium isotope. Along with this, an enormous amount of energy is released, which is several times the amount produced from fission.
Scientists continue to work on controlling nuclear fusion in an effort to make a fusion reactor to produce electricity. Some scientists believe there are opportunities with such a power source since fusion creates less radioactive material than fission and has a nearly unlimited fuel supply. However, progress is slow due to challenges with understanding how to control the reaction in a contained space.
"
This is where these massive versions of magnets can assist in containing the energy produced in the tolamak.