> Most countries don't have this advanced classes thing.
They actually do. They just group the advanced classes in an elite "prep schools" track, whereas everyone else gets the crappy "vocational schools" track. The worst part about this is the pathological incentives it creates among teachers. No one wants to teach bad students, so the "vocational" track gets the worst teachers, and the divergence in outcomes becomes ingrained.
> No one wants to teach bad students
That's not true, but maybe there are too few good teachers who do that...
It's true enough to a first approximation for individual teachers, and what's more relevant, it's systemically true for the educational establishment as a whole. Which means that effective methods for remedial education (such as Direct Instruction) are not taught in Schools of Education and not known among teachers, except for those who opt to go quite deep into "special" education. (And even then, those teachers are not going to teach your average class at a vocational school.)