If it were a case of "calories in, calories out", all the experiments down by food technicians to understand what is happening in the brain when you consume certain flavors (they were literally getting people to taste soda in an MRI scanner decades ago), would not be an efficient use of time and the food industry would collapse.
If you eat 2000 kCals of lettuce, your body is going to do very, very different things to eating 2000 kCals of potato fries, including how it stores or consumes energy in that moment. Importantly, what your body does is likely going to be very different to what my body does. 10% of the population can stay slim while over-eating crap, because they are genetically lucky. A %age of the population will struggle to stay at a healthy BMI even if they eat mostly salads and fruits.
This isn't radical new age voodoo: the best science available today tells us the calories in/out model isn't anywhere near nuanced enough to help educate people on eating healthily and managing their weight.
Tim Spector has written some material on this, and I've been reading Camilla Stokholm's book recently. It's all quite interesting, and very different to what I was taught when growing up.
I'd also do some digging on ultra-processed foods - it might stop you thinking overweight people are just doing it to themselves. They're not.