From an extremely simple viewpoint- yes it is calories in vs calories out.
However, it is way more complex than that. Every single person reacts differently to the food they eat.
If you had a room of 100 people eating the exact same diet & calories and doing the same activities/exercise, will still be all different shapes & weights.
Eating 2000 calories of crap like pasta mugshots, protein shakes/bars,low fat/low sugar yogurts and coke zero is definitely not good. You're just filling yourself with crap and the result will be more cravings.
Eating 2000 calories of actual food is better and healthier, even if you go over the amount of calories.
These diet programmes such as slimming world have a lot to answer for. They brainwashed so many people, predominantly women, that natural food is bad. Calling food 'syns'. Saying that you can eat a banana but not if its mashed? You can't eat avocado but you can eat sweets.
I think that's partly why there's such a big shift to less processed foods and moving away from calorie counting. People don't know what actual real food is aanymore. Fast food and junk food is way cheaper than healthy food, which isn't helping.
Essentially, eating a more diverse plant based diet of veg, fruit, nuts, legumes with good sources of protein, is naturally a lower calorie, nutrionally dense diet. Which stuck to 100% would reduce cravings for junk food and hav a positive impact on the body/gut/mental health.
However, our bodies are designed to want high fat sugar food and to eat lots of it, and it's in abundance. Who has time and energy (especially with kids) to cook everything from scratch, never go out for a special event, never eat a massive chocolate bar?