I was the one skinny kid amount the 3 overweight siblings. We all had the same level of activity and we ate the same stuff. The difference was the quantity of the stuff that we ate.
I had two dogs, roughly the same frame size. One was a Lhasa apso, and the other a schipperke/bichon mix. The Lhasa was always lean, and the mix was always fat. This was true from puppyhood. They lived together and had the same play/exercise activities. They both slept most of the day, as most dogs do. Their environment was pretty much exactly alike. In fact, the only difference is that the Lhasa actually ate more than the mix. Again, the thin dog ate more, often eating the fat dog's food as well.
I think metabolism accounts for a lot.