The weight set-point theory
Have you heard of the weight set-point theory? According to this theory, there is a weight range your body is comfortable at and it hovers around give or take a few pounds. This range is determined by your genetics and your environment/habits.
But the thing is, we can shift this setpoint. If we eat excessively and live a sedentary lifestyle (due to stress, anxiety, busy lifestyle, emotional eating, depression, hormonal imbalance, or any other reason) for a relatively long time, we gain weight and override our body´s natural tendency of staying at the original set point. The new, higher weight becomes our set point.
The body likes to keep things the same, it´s called homeostasis. This also applies to our weight. Whatever weight we had for months becomes our new set point.
A part of the brain called the hypothalamus helps maintain this set-point. It does this by controlling hunger, appetite, and metabolism.