"tracking" is the solution to that (or at least minimizes the impact)... e.g remedial, normal, and honors classes... magnet schools, etc.
but the focus in the US education thinking and efforts for the last 30+ years has been more "closing achievement gaps" between ethnic groups rather than increasing average gains.... because "equity".
Tracking works and we should have more but how does that solve the problem of average performance if you're leaving the majority behind?
Ignoring correlations between poverty, ethnic groups, and achievement and the fact there's schools where 2/3 of students can't read at grade level while just telling poorer schools to spend money on more parallel tracks doesn't help the average. Where are you saying the the new money and teachers should come from?
If you only have a single 7th grade class, then you can't do tracking (in the basic way), but let's say you have 2 7th grade classes. 48 students total.
Further let's say you straight rank them by "ability" (prev grades, IQ, whatever) into 4 groups of 12 A, B, C, D.
You can then choose to either "balance" the classes (e.g. each class has 6 from each group) or you can track them. so the fast class is all A and B and the slower class is C and D.
In the balanced model, both classes proceed at about the pace of about the C group. The B group are under challenged, the A group are bored.
In the tracked version the faster class goes at ~ B+ pace. The slower class goes at D+ pace. In both cases more people go at a speed that's closer to their level of ability. The only arguments against this (afaik)
That's the most basic model but there are others where maybe for a few hours every other day the slower kids get extra tutoring on the basics, the smart kids do "enriched" stuff. and the medium kids do medium enriched stuff.
(though this version kinda sucks for the remedial kids... i guess )