What you eat and how much you eat is tightly controlled by your hormones, you never need to think about it, normally.
In a healthy person homeostasis will maintain your body at a healthy weight.
But a response to environmental variables, or to lifestyle choices, can upset homeostasis and create a set point that's not ideal for your health. That implies that there is some deregulation going on.
Several hormones are involved, sex hormones, growth hormones, the blood sugar regulator insulin, and the fat storage regulator leptin are mostly involved. To a lesser extent the stress hormone cortisol plays a role.
Insulin is the hormone that instructs the body to burn glucose, and to store excess glucose, either as glycogen or as fat. Leptin signals are suppressed if insulin levels are high.
Insulin resistance is the bodies response to high levels of insulin in the blood for a long time. It's an adaptation to too much insulin. (Like drug addiction.) But in the continued presence of glucose there's a problem, excess glucose must be stored, so even more insulin is produced. Insulin resistance tends to become more severe.
When insulin is 'on' the body tries to store excess glucose as adipose tissue, as body fat. Insulin resistant people get fat unless they learn how to turn insulin "off."
This theory tells you how to lose weight easily. Both fasting and eating a very low carbohydrate diet allow you to keep insulin turned "off." It's easy to do and you won't feel hungry.
If people are underfed, their bodies adapt and they don't lose as much weight as expected. The body turns down the metabolism rate and conserves the limited energy available.
On a diet very high in carbohydrates, and low in fats, people can still become obese even when they are underfed (Western Sahara Refugees).
If people are overfed, their bodies respond by wasting calories. They don't put on as much weight as the theory suggests they should.
The standard theory is that your input of energy (food measured by calories) must equal your output of energy (metabolism measured by calories) or your body weight will change.
Adipose tissue is like a bank account, body fat is the storage of energy in case of a future famine.
If you are too thin you need to eat more. If you are too fat you need to eat less, or alternatively exercise more.
This theory doesn't deny that hormones are involved in obesity. It merely states that excess calories are the cause of obesity.
This theory is under severe attack, and it's proving difficult to defend.
If you are young and healthy, this theory serves quite well. If your are older and insulin resistant, this theory isn't very helpful, it encourages you to do things that are ineffective in controlling your weight.