There are a lot of factors that influence how well someone scores on standardised testing such as university entry rankings. Your school is one of those factors, but so as personal aptitude, motivation, support, time, and background.
A good student is unlikely to be significantly disadvantaged by their school, but an average student will do much better in a private school for a number of reasons. The teacher will be able to spend more time with individual students in a better equipped environment. The parents of students in private schools have decided to invest a large amount of money into their child's education indicated that the family values academic results, they are more likely to invest in private tutors, etc. Weak students can be coaxed into scoring very well in private schools where they might do very poorly in another setting.
High school examinations, like all examinations really, are heavily influenced by technique as much as ability and if someone has more time and help to learn an appropriate technique they can perform above what their intelligence (as measure in logic and reasoning skills) might otherwise suggest.