The problem with “calories in - calories out = weight gained” is that even though it is of course true (thermodynamics), it explains nothing. If I asked you “Why do children grow bigger?”, and you said “because they eat more calories than they expend”, again you would be correct but have told me nothing. And if a child wasn’t growing like they should, you wouldn’t say “just keep feeding them more”, you would look for possible disruptions of their hormonal system.
The reality is that the body is a finely tuned bio mechanical system with feedback loops that are capable of regulating your resting metabolic rate in order to target weight gain, loss, or stasis. The question is why are so many people’s regulation loops so out of whack?