When compared to a lower ranking school the same internal ranks but at a higher ranking school usually mean better results in the external exams. A higher ranked school might also have better facilities and/or teachers and encourage students to try harder due to competition.
That's mostly what it comes down to, but it's also favourable to have your cohort perform well as a whole (first and last excluded) when it comes to the moderation process for internal marks. There is a good video somewhere which explains moderation in detail.