Laziness. In my case. Teamed with prevalence of junk food in the UK (I'm an immigrant from a 'slim' country) and non-judgement of fat people here (the opposite to my country).
I was always slim. Immigrated to the UK, lots of new things/occupations here, no time/inclination to cook. Started relying on processed junk food and genuinely loved it. Pizza's, burgers, etc - what's not to like. Gained some weight.
Then married and had a baby after a while. (Ex)H was also a big man, loved eating lots and loved junk. Same as me. So we did. My weight went up to 111kg (starting was 59kg), I'm 1.8m height.
There are a lot of fat people in the UK, so I didn't feel exceptional in any way. No one said a word to me or treated me badly because of my weight. There were plenty of clothing in my size in the shops. Also, I was 26 then, young and didn't feel any effects on my health yet. All those things meant zero motivation to lose the weight.
Until one day I snapped. Saw myself in the mirror, with fat rolls lulling everywhere, squeezing myself into size 20 jeans. Double chin, grey skin, bingo wings, touching thighs, sweat. And I wasn't even 30 yet.
Started calorie counting, went down to 55kg in less than a year, and have been maintaining it for the past 10 years, I'm 37 now.
In my case, there were no mental issues, stress, health issues, meds or similar. I knew what healthy food was, I knew what I had to eat, I just couldn't be arsed and junk tasted so good. I was greedy and lazy. It's my personal experience, people and their stories differ, of course.