There's a few ways it can do so.
1. Depression: if life itself feels pointless, why care about your health?
2. Environment: lots of snacks, lots of work, little free time can add several kilograms.
3. Upbringing: if all you did in your high school and university life was hang out with friends and play computer games or generally un-athletic activities, the habit and drive to keep pounds off is absent.
4. Stress: if you're dealing with a really hard project at work or school, you may "put off" exercise and eating well, in order to give you time to finish it and comfort for the hardship. And when you do get some free time you may want to just lie around.
5. Money: if you're poor cheap snacks and unhealthy but high calorie meals are readily available at almost every corner of your city or town. There's no place in my downtown area where I can grab some roasted vegetables quickly to take back to the office. The salad places are expensive and also have high calories from dressing and lots of nuts and cheese.
6. Disorders: addictive personality being the foremost in my mind. If it feels good, keep doing it. Even if you don't need it. Even if you're almost full to bursting.
There's more I'm sure, but those are off the top of my head.
Speaking only for myself, it's simple: I'd never known anything different. I'm 6'2", and was ~230lb when I graduated high school. On January 9th of this year I was 318lbs, and decided to make a change.
I'm 285lbs now and still dropping a few pounds every week. My clothes are starting to fit poorly, I've had to adjust my watchband twice now, and my wedding ring will barely stay on my finger.