The simple answer to the question asked by the OP is that there's the same average spread of children and ability in areas, regardless of the schools, so you'll get broadly the same results.
Where I live, we have 2 super-selectives that cream off the top ability. They get 100% A* to C every year. You then have two faith schools that strongly select based on church attendance but actually try to cream off what is meant to be the next layer, and then there's the 'all the rest school'.
Looking at that model, you'd expect the last school to be the worst, and demographically it should be. Lots of children from poorer backgrounds, the city's sink estate and the rest. The "bad eggs" as some shittily call them.
However, it comes out with a 60-70% pass rate, has the best value added score in the area and is known for it's fantastic pastoral care. It's an excellent school, with low levels of bullying, excellent behaviour and children who achieve above expectations.
Where the girls school is renowned for bullying (brushed under the carpet), the boys has little to no pastoral care whatsoever so kids with home problems and the rest quite often leave (better to get rid than deal with it) and so on, and so on.
This isn't the same everywhere, of course. It just irks me somewhat that the automatic assumption is that Grammar = nice children and nice behaviour where comprehensive = not so nice children and behaviour.
I went to the girls school here. There were as many bad eggs as there were at other schools. Just ones with better academic ability. Problems being brushed under the carpet, doesn't mean they don't exist.