It is completely false that weight gain/loss is all about willpower, or making a "choice" to do this or that.
Obesity is a very complex disorder with dozens, if not hundreds of contributing factors.
There are numerous genetic variables that have been shown to associate with obesity, and various medical conditions (hypothyroidism, PCOS, depression) that can increase the risk of weight gain.
The body also has numerous hormones and biological pathways that are supposed to regulate body weight. These tend to be dysfunctional in people with obesity, making it much harder to lose weight and keep it off.
For example, being resistant to the hormone leptin is a major cause of obesity.
The leptin signal is supposed to tell your brain that it has enough fat stored. When the leptin isn't managing to deliver its signal, the brain thinks that you are starving.
Trying to exert "willpower" and consciously eating less in the face of the leptin-driven starvation signal is extremely difficult, if not impossible for many people.
Eating is driven by behaviour, and behaviour is driven by physiology and biochemistry. That is an undeniable fact.
Of course, this doesn't mean that people should just give up and accept their genetic fate. There are certain foods that will heighten the effect of hormone imbalance, which will just add to the problem. Losing weight is still possible, it is just much, much harder for some people. And a longe term approach to lifestyle is the best way to prevent things getting out of control.