As far as I can tell, this would rely on privatization of the school system, as I don't think I've heard of anything like this in a publicly owned school.
Or the bad school could sell themselves to a good school. If School A
(which is run by company A) competes with school B (run by company B),
and school A sucks, they could sell themselves to company B, so company B
(the better company) runs both schools, enabling the typical student to
be educated by the better of 2 school options. If there are 10
schools, the 9 worse schools eventually sell themselves to the best
school, and now most people have a better education.
This relies on the presumption that school B is better because company B has a better way of running the school and is capable of delivering a better education. I don't see any reason to suspect the success of a student would be related to the administration of the school. Rather, I think the success of a student is based on the quality of the teachers, the effectiveness of the curriculum (which I'm presuming is still standardized, because otherwise we would run into many other problems imo), and personal factors in the student's life.
My point is that, unless company B is simply able to hire better teachers and ensure that they perform well (which, if they could do, why wouldn't every school do that?) and would be able to get around the fact teacher's unions make it nearly impossible to fire an under-performing teacher, there is nothing that makes company B better than company A.
The only thing that differs between school A and school B is that school A (which I am using as a placeholder for all 'bad' schools) might be populated by mostly poor or marginalized students, might be in an area with a high crime rate or that is perceived as being 'unclean', might have lower scores on standardized tests, among other things. The only way I could see school B being an improvement is that they hoard the best teachers, which they would only be able to get from paying them the most money. This diverts money away from the students and forces unequal distribution of qualified teachers, forcing schools who can't afford those teachers because their student count is declining won't be able to catch up unless they divert even more money away from students.
If a school A is underperforming, the solution isn't to then have students leave school A, force school A to shutdown, bring students to school B where the same personal/socioeconomic factors would continue to exist, overburden school B, make them buy school A, place students into school A, and then be back in the exact same place. It's such a roundabout way to placate people who want their children to go to 'good' schools without changing anything and, during the transition, depriving schools that most need it of their funding. To me, it seems the logical conclusion is inequality and less money going towards actually helping students (even though I agree teachers should be paid more, a model surrounding the highest bidder is not the way to go).
If we want a better education, we need to improve the school system, not make it so that way an opinion that very well may have no basis in logic about what is a 'good' or 'bad' school determines the ability of said school to survive.