There are lots of different factors but a few points based on comments I've read.
Obesity isn't necessarily related to money or IQ but lack of money or knowledge about food prep don't help. Plenty of middle class obese people about though and genetics will play a part.
Mental health and neurodiverity are issues for a lot of people, even more so as they hit their teens and in to adulthood and they impact how you feed yourself and how you feed your family. These things are not inherently conned to wealth/class.
Working full time, multiple kids activities, commute times - where are you finding the time to cook from scratch every day and do your kids not reject your healthy meals?
PE in state schools is still abysmal and puts a lot of people who are not naturally sporty off exercise, whilst the thread is about food, it's a factor in obesity and healthy habits
Stats for childhood obesity likely come from the weight measurements they do in reception and Y6. If it indicates a child is overweight a school nurse will call and offer help if you want it. A lot of the advice given will be undoubtedly towards low fat UPFs.
Food tech is still a thing and seems quite unchanged in the last 30 years, I suspect most kids give it up when it gets interesting at GCSE because remembering and lugging the ingredients in on the bus is such a pain.
School dinners in the 80s were virtually inedible, they moved to being over processed and now they seem vaguely better. Still a lot of all day breakfasts and fish fingers going on. My DC went to an event at a private school (one of those where they invite the poorer kids in) and he said the school dinners were amazing.
I'd note that I became overweight aged 16 mostly down to my 6th forms cheap sausage barms and probably over consumption of vodka red bull and beer 🙈 These things were cheap (maybe not the beer) and I was mostly in control of my own finances. Show me a teen that doesn't sometimes make dreadful food choices.
I recall most m/c kids in my primary eating a ham sandwich, club biscuits and ribena in the 80s/90s. I also recall having small chocolate bars and multi packs of crisps at home to have on moderation around home cooked meals as did most of my friends Maybe it was simpler less judgemental times 😂 Lot of judginess these days.
We can and do cook meals from scratch at least 5 days per week, free access to fruit, but I also buy hula hoops and biscuits. I think most people do a mix and generally the majority are doing their best with the time, capacity and resources they have, which may not be consistent day to day. It's not as simple as to say you must prioritise your kids health.