Your HSC mark is calculated by the average of two components. One is your actual exam mark - this is not moderated in any way. The other is based on your ranking in your school. This is moderated based on your schools performance and is rather complicated.
Best illustrated with an example:
Your teacher will give you an estimate from 0 to 100 along with your entire class. Your estimate will in fact "rank" you in that class.
Lets assume your teacher estimates the people in your class all between 54 and 92. Lets also assume you were given the estimate of 92 and are ranked 1.
When your class sits the exam they actually get scores ranging from 48 to 89. You had a poor day and only got 83. What the board will give you is the following marks.
Exam: 83 Estimate: 89 Mark: 86 (the average of the other 2)
You will always get your own exam mark.
You got the estimate 89 because the teachers estimate is moderated to match the actual performance of the class. As you were ranked number 1 and the highest exam mark was 89 you get it. It does not matter that someone else got this exam mark - you are ranked 1 so you get the top ranked score. If you were ranked at the bottom you would get the lowest rank - 48 regardless of who actually got that score in the exam. These figures may vary slightly due to the complicated mathematics used but not by much.
Effectively your class will recieve new estimates that range between the lowest and highest exam marks. The board will keep to the ranking given by the teacher and stay close to spacing of the rankings also. That is to say if you are 5 marks lower than the guy ranked above you your new estimate will try to reflect that gap also.
One other way of looking at this is that your school gains a pool of marks ( add up everyone's exam mark) and these marks are shared amongst all the students based on the ranking by the teacher.
This means that if you are ranked 1 you will get the best mark produced by any student in your school as your estimate. If you arent ranked 1 you cannot get the highest estimate. Remember this is the estimate component only - you will get whatever exam mark you achieve.
Hope this hasnt confused you more. If it has just remember that your class ranking is of supreme importance for calculating your estimate. The estimate will be combined with your actual exam score to give your HSC mark.
BTW Your UAI is based on the combined mark.
PS I didnt take it as bragging but an exclamation of good fortune. Hopefully the fact that you studied all those past tests indicate that you are a good student and deserve the number 1 rank anyway