This is indeed something of a mystery and there are several possibilities. First there are a lot of different genes that control our weight and metabolism, differences in these genes and they way they work between people could be one reason for differences in weight gain. Another possibility is differences in exercise or movement. You might notice that some kids fidget a lot (can’t sit still, tapping their foot etc) and are generally very active which means they burn off calaories at a higher rate than kids who are more sedate and move less. A third possibility is that during our development in the womb we can be exposed to chemical signals that prepare our bodies for the life ahead and these can influence our body shape after wer are born and even into adult life. So as I said, it is complicated and not easy to give a precise answer to your fascinating question 🙂
These kids could still be different in two major ways that interfere with how much they are going to weigh: their genes, and the environment around them. The latter is more interesting, because we can shape it to some extent. It includes questions as to whether mum smoked while she was pregnant with us, and whether what we eat is commensurate with what our body needs, which again varies according to what we do with it (e.g. chilling out in front of the TV, or going for a bicycle ride, or trying to make sense of what someone else wrote while staring at a computer screen). And all this is made more complicated by whether you enjoy what you eat or do, or not.