Simply put it's free market forces at work. People who can afford it wouldn't if it added no value. Private schools are motivated to innovate and provide greater value. So they do. There is also a holistic approach that isn't just about grades. It's about the out of class clubs and activities you can get involved in, also the general culture of the school builds confidence.
I was privately educated, but I think some of these things can be replicated and perhaps even exceeded within the state sector. First off we need to fund education way better than we do. Two areas I'd be happy to pay more tax for are education/ health, unfortunately not every fellow voter agrees with me.
Second parents need to be given more meaningful choices, rather than having to lump what they have in their local area. We spent around 4.4% of our gdp on education in 2017 tracking a general decline over the decades, health spending I think is at around 9.8%.
What I'd propose is some consultations within these respective areas and a bill proposed that percentages of our nations gdp be committed to health/education relative to our needs in these areas, to be met by increasing our tax burden with 25% of the sum supplied by the richest 1% the next 25% supplied by the next richest 9% (so in short the richest 10% would meet half the sum) and the remaining half funded by the rest of the general population. I'd put a block on generating this amount by increasing the debt.
I'd couple this with a massive reduction in corporation taxes, as we would generate far more in income tax as we'd make ourselves a very attractive and competitive country for large companies to settle here.
To bridge the attainment gap I'd encourage competition between schools that made children from poorer backgrounds more valuable, so if you have more of them, and you maintain and meet high educational standards your school gets more money. This would attract some of the better teachers.
People follow incentives and at the moment the incentives in education are all over the place and make no sense. I'm just a layperson, so doubtless what I'm suggesting may be unworkable, or would require more input and refinement from those in the field, but that is my opening salvo in tackling the problems.