To my understanding, it happens like this:
High (internal) rank, at a school that performs well in the subject-
If your internal rank is good, and then, for whatever reason, you bomb the externals, your good internal rank and high-performing cohort means your internal will still be good, but you'll keep the bad external.
High (internal) rank, at a school that performs badly in the subject-
If you're well above the level of the rest of your cohort, and rank number one, but then bomb the externals because you've had a bad day or whatever, there's no insurance policy on your internal mark - it just looks like you've come first because of a lack of competition, even if that's not the case.
Low (internal) rank, at a school that perfroms well in the subject -
If you perform poorly in the external, and you have a low rank, the performance of your school probably won't really help you.
If you have a low rank, but perform well in the external, in all likelihood your rank is low because you have a competitive cohort, and when the schools are aligned (this is not scaling) you will receive a good mark compared to the rest of the state, because your entire school will sit higher.
So - your school only ever actually works as an insurance policy on your internal mark - providing everyone performs well on the external. The only way to do well is to work hard - no school will save you if you don't put in the effort, and no school will bring you down if you perform consistently and highly.