My SO taught in public schools. One was a 'standard' public school, the other was a 'charter' school [0]. I have some second hand knowledge here.
The parents make all the difference.
Yes, poverty is a huge factor, but some parents are more in touch than others, in spite of the poverty.
At the 'standard' school, it was a mess that I won't burden the reader with. One key metric that I found interesting was that the teacher drop-out rate was ~80%. This gives an idea of the quality of the school.
At the 'charter', every single graduate has gone to college in some form. They are quite proud of this metric, as they should be. The 'charter' was richer on average, yes. But many of the kids were opting out of the 'standard' school and going to the charter. The income of those kids' parents was similar to the 'standard' school. The population of 'poor' kids that went to the 'charter' school was much less though.
[0] It's publicly funded, but still a charter. The local district is not like most. Every parent/guardian is forced to rank the schools for their child to go to. All are open for enrollment. City Bus passes are provided for every child for free in lieu of school busses. It works, but still has a lot of issues, like most places.