Its not about eating healthy food, obesity is about the over consumption of food. You can maintain a healthy weight eating hamburgers and fries every day. The problem is portion size.
Diet is more complicated than that. I lost a significant amount by being on a low-carb diet. I didn't really try to control the portion size - though that may have happened naturally. What you eat does matter.
High fat and high protein provides high satiation which prevents the over consumption of calories. I've also lost significant weight on a keto diet. I've also done it with intermittent fasting and eating anything but keeping my calories below my required calorie intake.
The human body is not a pneumatic system that you push food through. It has a nervous system attached to it which changes your mood in ways that affect both the intake (hunger vs. satiety) and expenditure (laziness vs. feeling energetic) sides of the energy equation.
If you listen to people who have had success with low-carb and/or keto diets, their comments almost always discuss how the way they feel about food changed. They weren't hungry and they felt more energetic. Just about 0 of them mention spending time tracking calories consumed or measuring calories expended.
I've done keto diet while eating bacon, lettuce wrapped hamburgers and other high fat foods. I had full blood panel blood work done and everything was fine.