When you do not have a selective system - this is what happens. Middle class areas get middle class schools. Poor areas get poorer schools.
SURPRISE!
There is an incredibly fair system which prevents this - it is called grammar schools but the left destroyed most of them. Ironically, the children who have suffered the most from this abolition are intelligent kids from working class homes.
My wife, myself and all of my oldest friends came from lower class homes: kids with a bit of intelligence and a genuine work ethic were raised up in society.
In a bad comp' - most of us would have failed.