The problem with most approaches to weight management is that the body has no mechanism to measure, monitor or manage weight. You can try to manage your weight, but the body has no system to achieve weight management.
Instead, the body measures, monitors and manages energy. And in terms of managing energy, you are only in indirect control.
You might find this article interesting:
In a nutshell, it looks at the relationship to how much energy is taken in and how much is available for use--and how the nutrient form of the energy taken in impacts what is available to the body.
The advice of "don't overeat" is a little simplistic in light of the way our body manages energy. This is especially true for those of us who tend to gain weight easily.