People on a diet do not regain weight because they count calories, on the contrary, because as soon as they hit the target weight, they return to the same eating habits that made them fat.
Weight loss to be durable needs to be programmed in the long term and is mainly a change in eating habits, otherwise it will not work. That's the problem, people looking for quick results are not programmed, they do not create strategies to lose and especially maintain the new weight.
Calories do matter. No matter what you do, ketogenic diet, low carb, intermittent fasting, if your daily expenditure is 3000 calories and you ingest 4000 calories you will gain weight regardless of dietary strategy.
Use our ancestors as a example is bullshit. They were not obese because the food was scarce, because if in the stone age there was a shake shack on every corner, I bet they would be obese as well.