The mode of operation your body is in is what influences your weight.
It is like the temperature. When you are sick and the body decides to raise the temperature, it will raise no matter what you do. You will just fight yourself if you don't like it.
It is the same with weight. When you are in fight/survival mode, you need to be agile and fit to survive. This is what your body sets as a goal and achieves with appetite and hormonal changes.
But if you are is rest mode, the body will want to store fat and you will crave more food. If you don't like it, you will just fight yourself. Very often, ineffectively.
The secret is the mode, which is determined by your perception, purpose, goals, activities, and environment.
