Body weight is very highly correlated with the environment and financial circumstances people live in.
In some areas it is very hard to find and afford fresh food and to cook. But it is easily to buy ultra processed foods pretty much anywhere.
UPFs have been engineered to taste great, are quite addictive, very easily available, often much cheaper than fresh whole foods, and they keep very well. Hence many people eat them - and why wouldn't they? However, they are also very high in kilojoules, low in nutrition, don't need much chewing and way too easy to overeat, hence many people who eat them are overweight.
Also our bodies have not evolved quickly enough to be able to cope with stuff that is basically not even food, hence the many health problems that abound when eating UPFs.
If we treated UPFs as an addictive substance we might get somewhere. I say this knowing it is a highly controversial view and that people also don't want to be told what to eat.
Until governments get serious about cracking down on multinational UPF manufacturers like Nestle and Coca Cola and start making it difficult for them to advertise, and also reduce the fast food places everywhere it will continue to be very hard for most people not to be overweight.
To the OP's question then: why are some people not overweight? Well it's the opposite side of the coin isn't it? In general people who are not overweight have more money and greater ease of opportunity to eat fresh whole foods as opposed to UPFs.
In my own case, which is kind of irrelevant because it's a sample size of one, but I'll mention it for interest: I am bordering on being overweight. I have been slimmer and I have been heavier. I hate diets and cannot sustain them. I decided to make a lifestyle change and I cut out UPFs. I don't buy them because otherwise I would mow my way through them as I have absolutely no willpower. That made a big difference. (The YUKA app is very helpful to use at the supermarket. You scan the bar codes and it gives a score out of 100 and also recommends healthier items. It's an eye opener to see the crap in some of these so-called foods.)
All this is easy for me to say this though, as I live near easily available fresh food, and can afford it.