I think that's what PPs are saying, but in my opinion that's incorrect.
I have a diet that most would consider extremely healthy. Loads of veg from the allotment, massive salads, avocados, home made sourdough bread, pulses, seeds, kimchi, etc etc, no biscuits/ crisps, strictly limited chocolate etc....
But I struggle to maintain a healthy weight. Because I have a massive appetite, therefore I have massive portions of all this healthy food. Which still contains calories . Following the 3 slices of homemade sourdough with avocado, kimchi and a side salad with a generous helping of muesli, soya yogurt and berries IS going to pack the weight on, I can assure you!
I think most of this comes down to appetite. I'm convinced that, yes, ingrained food habits may come into it, but a lot of body shape being hereditary stems from inherited appetite. Whether it's a predisposition to produce more or less leptin or other appetite- regulating hormones, or something to do with your gut biome, who knows? It seems to be a very new field of science.
But I'll bet my bottom dollar that those who claim it's all down to eating healthily are strangers to the sensation of being constantly starving.