Mostly genetics, and some of my lifestyle.
My family is really diverse. I probably have about 180-200 people living. In age , and youth there's a variety of bodytypes. My brother, sister, and I all represent the three somatotypes, and while we didn't
strictly do the same things as we grew older, there was a pattern, and we still ended up being different.
I'm ectomorphic. My brother is mesomorphic, and my sister is endomorphic (But she's kind of an hourglass). We've got our pros and cons within that. We have certain activities that we've done (Sports and so forth), but a lot of times, the intensities and frequency would be similar. My sister used to dance everyday for 30 to 120 minutes in her room (Still does about the same), which is roughly how much I'd practice martial arts, and so on.
I wouldn't say our shapes are strict, but we really haven't changed much since we were kids, except for me. I was a little fat for a part of my young life, but then I grew taller, and lean. Oddly enough, I actually got weaker physically when that happened, and I still am (Though recently my stamina is up a bit from my training: Not my size change; I'll be nice and say that maybe my extra speed is a training/size change thing, but much more former, less latter).
My brother has been weight training and practicing martial arts for a very long time. His training has an effect of course, but if you see his dad (Who at almost 60, the former marine has PYTHONS! OHHHHHHH YEAAAAAAH!!), you'll see that has something to do with it too. lol
I think my sister has my moms bodytype. They're curvy (And they look like twins ^_^), but my mom is psychotically fit and strong. Like training to run 12 miles in her 40s fit.
As for me, my lifestyle hasn't changed much in the last eight years regardless of my bodytype. I started practicing martial arts regularly at 12 (I did a little boxing before too), and I added some weight training too. My bodytype never really changed minus the growth spurt, but I was always one of the fit kids.
The only really big change was when I started my old job. My bodytype change a bit (I lost muscle, because I had no time to workout ever, with college/40 hours a week job), and I ran to sleep problems that I am still dealing with today. But within five months, I started to cut myself off of the food not because I think McHell has ****-quality crap, not worthy of eating. I had fun with it too. It was like a ritual lol.
I haven't put on any weight (Except for the Freshman.... three for me lol), but my build keeps going back and forth... It doesn't help that I have to be strong, and be able to run alot too. To prepare for SERE school, when I go to the gym, I have to run a few miles on a treadmill, then strength exercises, and start swimming soon as well. I don't seem to be building much (More weight on the rack yes, but eh chi'...), but it's what I got honestly.
Although this is really complex (There's thousands of factors really), I don't really know of two factors most have listed that has more of an effect, but right now I'm leaning more towards my genetics. I've had times when my lifestyle wasn't perfect. I didn't gain weight, but my build may/may not have changed to some degree. That might be due to going from training regularly to not training though.
My highest weight was maybe 5, 10, 20 pounds heavier than now with varying heights attached.
It seems to be the same for my brother, and sister as well. If they try to make drastic changes, they don't really seem to have a lasting positive effect (And I use that to mean whatever their goal is), unless they change permanently. But since we're all living healthy already, I don't really see the point, unless it's a little supplement here and there (Like protein for my brother), something for some sport/activity one of us does, or something else that's really minor.
The older members in my family? Same thing, and certain diseases (Mainly hypertension, liver disease, my mom and brother have this kidney disease whose name has slipped my mind, et cetera...) hit everyone regardless of size unfortunately. But the thin ones staying by the fat ones, doing the same things.
So yea: Right now I'm thinking genetics is stronger (If not in control lol), but I might not say that years down the line depending on how I change.