I know how I got fat as a kid:
Mom showing love through food. She loved me, food tastes great. I ended up conflating the two and using food as a replacement for comfort and stress ate a lot for a good portion of my life.
Lack of exercise. Helicopter parenting meant I couldn't leave the house very far. I didn't have many friends growing up and even if I did, I couldn't hang out with them outside and had to be with some sort of adult supervision. I was easily bored as a kid (and still am; it's pretty pathological) so I ended up boredom eating a lot, especially during summer vacation. Efforts from my parents for me to join organized sports failed; I didn't like sports and preferred thinking and learning. I still don't like team sports and prefer solo or small group sports that suit my social preferences.
It became a self-fulfilling prophesy. I was fat and it affected my self esteem so I didn't want to be active in front of others so it just spiraled further downward until I stopped caring what others thought as an adult and sought my own fulfillment and figured out what worked best for me.