The marks that you achieve in your school-based assessment tasks/exams (for example, your essay and reflection) only serve to determine your rank relative to your cohort in the subject. This rank, alongside HSC exam marks achieved by your school cohort, is used to determine your Assessment Mark (i.e. internal mark), which contributes 50% of your overall HSC mark in the subject. This process is called moderation. Essentially, the higher your rank within your cohort, the higher your Assessment Mark is likely to be. In terms of the HSC exam mark (otherwise known as the Examination Mark), it is determined solely through your own performance in the HSC exam of the subject, and is not affected by factors such as your internal rank.
The HSC marks that NESA informs students of are not scaled, but aligned. Alignment is simply a process that modifies a moderated Assessment Mark and a raw HSC mark, producing an overall aligned HSC mark, being the mark that is reported to students. Alignment has no effect on a student's ATAR. On the other hand, scaling is performed by UAC as part of determining a student's ATAR and occurs after the moderation process. UAC takes a moderated Assessment Mark as well as a raw HSC exam mark (i.e. both marks are not subject to alignment), producing a raw HSC mark. This is the mark that UAC scales, resulting in a scaled HSC mark to be then used in determining the student's ATAR.
I hope this helps!