We lived in a grammar area. When the DCs were born there was no way they were going to attend our local secondary High school, as it was dire. By the time DS1 actually went there it was a fabulous school and oversubscribed.
It was still in the middle of a very rough council estate and it still took about 50% of its pupils from that estate. But what made the difference was the new Head and the SMT.
They were really strict on uniform and on attendance. I don't know why uniform makes so much difference but IME it does. They really pulled that school up by its bootstraps and its pastoral care was second to none. The Head knew every pupil by name and was approachable for the kids and the parents. Problems were dealt with immediately and properly. DS1 did have an incident of bullying in Y7 (any school that says they have no bullying is lying) but it was investigated and swiftly dealt with. It wasn't repeated.
DS left there in 2004 after GCSEs. The Head retired on ill health grounds in 2005 and sadly the Deputy Head died. The new Head wasn't interested in the uniform and started to let standards slide. By 2008 it was a sink school again :(
A school can be made or broken by the quality of the leadership team.