I think a lot of obesity is genetic predisposition and lifestyle in addition to diet.
genetic predisposition to eat too much, and to eat the wrong stuff.
When I fall off the wagon and have a few cokes, my weight goes up, my swims get slower, my sleep gets shittier. It becomes self fulfilling, worse sleep, want more caffeine and sugar, weight goes up, swims get slower, reduces motivation.
I get rid of the sugar, that weight goes away, I get lean again, I sleep like a rock, I swim fast. That process usually takes about 10 days of detox (granted I never let it get too far gone).
Frankly, the whole Ozempic thing proves it. People shoot themselves up with Ozempic, and it isn't burning off all the crap they eat - it just nukes their appetite, they eat less, lose weight. My nephew and his wife showed up to a wedding this summer, they had gone from being disturbingly overweight to reasonably sized if not thin. I commented to my wife that they really had gotten onto a plan and she said "What they got onto was Ozempic". At the wedding, they each had like 2 drinks and didn't finish their dinner. That shit must really do a number on you.