The prodigy at High will come across as a prodigy: not only will they have the better GPA, they're also more likely to have the nice "extra factors" that play well in admissions--class valedictorian, leadership in student council or maybe other clubs, etc. By contrast, the mediocrity at Academy has a worse GPA, and is unlikely to get nice statuses in those other extracurricular activities (who will be snatched up by the prodigies at Academy). So for the mediocrity at Academy to be marked as better, the admissions officer has to know of Academy and its reputation... and that's less common than you might think, even for the most-highly-ranked exemplars of Academy.
The other factor to bring up is that mediocrities at Academy are often competing against the prodigies at Academy; many schools don't want to admit too many people from Academy and will have a cap on the number of admissions.
[Yes, I did go to such an Academy, so I have some personal experience on the matter.]
The prodigy might be valedictorian, but might not. Maybe this student is gifted at math and gets all perfect math SAT scores and subject tests and mails in the rest of their classes for easy A’s.
The prodigy at High will come across as a prodigy: not only will they have the better GPA, they're also more likely to have the nice "extra factors" that play well in admissions--class valedictorian, leadership in student council or maybe other clubs, etc. By contrast, the mediocrity at Academy has a worse GPA, and is unlikely to get nice statuses in those other extracurricular activities (who will be snatched up by the prodigies at Academy). So for the mediocrity at Academy to be marked as better, the admissions officer has to know of Academy and its reputation... and that's less common than you might think, even for the most-highly-ranked exemplars of Academy.
The other factor to bring up is that mediocrities at Academy are often competing against the prodigies at Academy; many schools don't want to admit too many people from Academy and will have a cap on the number of admissions.
[Yes, I did go to such an Academy, so I have some personal experience on the matter.]