Habits mostly. Some of it from childhood.
Similar to @SpiceRat, would have lovely home cooked meals, but especially at uni, having learnt to cook for 4, I never really stopped even for one.
Then came all the additions - chorizo, butter, cheese, pancetta, garlic bread on the side. Obviously okay as a nice treat but they add up.
Following that came the takeaways, and the boredom. Almost hypocritical, in that of course I'd prefer a chicken tray bake with all fresh veg, but can I be arsed? No, so we have takeaway, oven pizzas, breaded chicken (which I've added too - chicken wraps or burgers anyone?)
That's just the main meals, laziness and gluttony.
When I'm dieting, I can do fairly well. I wish I was taught to meal plan properly. That would have been a better use of food tech at school that cheese and onion pasties and spag bol (that I'd been cooking for 2 years before we learned it).
But my main downfall is emotional eating. I eat when I'm happy, I eat when I'm sad and everything in between. When I have children I'm going to try extra hard not to use food, particularly chocolate etc., as a reward.
Diets tend to work if I can stick to them, but I still haven't worked out what triggers me to discard them. I lost 3 stone on SW once, put it all on, attempted 2/3 other things, lost and gained the same stone, put another 1-1.5 for good measure. Am currently back at slimming world. I have actively prop up my dedication everyday.