The 1st Law of Thermodynamics
This is basically a law regarding the conservation of energy: energy cannot be created or destroyed, it only changes form.
The system is closed—it doesn’t lose energy into thin air, nor can it create energy. If we eat more energy than we need it remains in the system (weight gain), and if we eat less energy than we need, then energy stores (fat) are drawn down (weight loss).
The Bottom Line: changes in body weight do come down to the basic math of energy-in versus energy-out.