The quality of education is dictated innate ability, parents, and school system. I like to think of as a three leg stool. If one leg is missing, it's possible to balance. If two are missing, no amount of money will solve the problem.
The stool has a fourth leg: other students. It's tough to get a good education if many of the other students are violent or disruptive. Public schools can't easily expel problem students.