I believe a lot of it has to do with the education level, personal financial success and parental involvement in the schools.
My daughter graduated in 2013 from HS. Her HS is public in one of the highest rated districts in the US and consistently in the top 50 HS's in the country.
The schools in this district starting with elementary all have heavy parental involvement and strive to be the best of the best. Our daughter's elementary school is Blue Ribbon Exemplary and more. It is one reason we built homes here vs anywhere else. Before we had our daughter, we planned for the school district as well.
I know there are a lot of charter and private schools and that is a personal choice. I might have chosen that route if we were in a bad school district but we pay a lot of taxes for our school and I am proud to have highly rated schools here. I like the public schools so children can be diverse, not coddled and be challenged to be the best.
From experience, my daughter is in her 2nd year of college and to this day, in math, the students from our district that go to her college are teaching the incoming students in some math classes because so many of the students who did not attend our district do not know the material being taught in college because they were never exposed to it in high school.