When we eat, we take in energy. This energy, which our bodies use for basic physical functions such as digestion, breathing, heartbeat etc., is described as basal metabolic rate (BMR).
We use the energy we have taken in for the BMR (about 60 - 75% of total energy used) and our physical activity (about 15 - 30%of total energy used). The remaining energy - around 10% - is used for thermogenenis (an increase in body temperature after eating). A good balance of energy makes a long-term stable body weight possible.
If we take in more energy than we use, we speak of a positive energy balance. Over time, this will lead to an increase in body weight. The excess energy can come about because we eat more than necessary, take too little exercise or - in very rare cases - suffer from metabolic changes (e.g. in certain illnesses).
If more energy is used than is taken in, we talk about a negative energy balance. This leads to weigh loss. The negative energy balance occurs when less is eaten than is consumed and/or physical activity - and the consumption of energy with it - is increased.