The process that you are describing is called moderation. This process is used to determine your Assessment Mark, which is the mark that reflects your internal performance and contributes 50% of your overall HSC mark in a subject, the remaining 50% coming from the HSC exam mark (known as the Examination Mark) achieved in the subject. The moderation process involves using a student's internal rank relative to their cohort as well as the HSC marks achieved in the student's cohort to determine their Assessment Mark in the subject. However, the moderation process is only used to determine the Assessment Mark (i.e. 50% of the overall HSC mark). On the other hand, the Examination Mark is determined according to a student's own performance in the HSC exam of the subject in question.
Essentially, the highest Assessment Mark (which would be awarded to the student ranked first internally) is made equal to the highest HSC exam mark achieved by any student in the school cohort. For example, Student A placed first in a particular subject, and the highest HSC mark achieved in Student A's cohort was 90. Student A will also receive 90 as their Assessment Mark. However, this does not mean that Student A "stole" the highest HSC exam mark, as the other student will still receive 90 as their HSC exam mark. Similarly, the lowest Assessment Mark (which would be awarded to the student ranked last internally) is made equal to the lowest HSC exam mark achieved by any student in the school cohort. In terms of ranks in between, the Assessment Marks awarded are usually not made equal to their equivalent HSC exam marks, although they will be similar (see the diagram on NESA's moderation page as provided by WeiWeiMan).
I hope this helps!