It's 50/50 OP.
Half is just reflecting the fact that the parents pay attention to their kids and explicitly value education. Imagine what it's like if your parents either set you to doing chores when you get home and never give a stuff if the teacher complains you don't do homework, or worse, if they're barely around at all.
Half is being in an environment where learning is not disrupted by bad classroom behaviour, and where the teacher can go at a faster pace and get more progress because the private school class kids are more or less the upper half or third smartest of the regular state school. It's having the school really motivated to get the kids good exam results and into good unis (and otherwise visibly excel and thrive in SOME way) because they literally will be out of a job otherwise.
If the comp is good with involved parents, good exam results, well mannered kids, no point paying for private school TBH as long as DC is working well and happy there.
I went to state primary and secondary and the good private school in my town after that. Not sure the teachers were any better at the last school BUT the classroom discipline was perfect, the pace of learning was faster, and crucially I got lunchtime tutoring for the Oxbridge entrance exam (as was at the time). I did have still to get up at 6am to practice past papers but the point is I got that support, and I got the place, got the degree to put on my CV, met my DH there.
FWIW my peer went to the good comp and then Cambridge and is a liver consultant so he did ok on the free track!
HOWEVER when I look at my contemporaries who went on to get doctorates it seems (and this is just my finger in the air, not proper science!) a lot more of them went to state schools. So there's that. Arguably not being burned out by an "academic hothouse" (my middle school English teacher's description of my high school - thanks for trying, Mr K!!) and having the earlier experience of needing to motivate and organize your own work have long-term benefits.
If OTOH the "good comp" turns out to be a stabby nightmare of a place where your kid cowers in the corner from the rival drug gangs... Yeah money well spent getting them somewhere peaceful!