I've largely been convinced that "good schools" are just a side effect of motivated parents migrating to an area with "good schools". It has nothing at all to do with the schools or teachers themselves, but the parents with means who make decisions based on education will likely be doing other things to encourage education as well. Achieving a critical mass of children with involved parents will make a school "good".
education is mostly at home but teachers do matter. Part of what is going on is that bad teachers get kicked out of schools with high parental participation so the errors are correlated I guess. If all parents became involved would bad teachers disappear or would the parents just have to live with them instead of being able to remove them?