For externals only, I believe everyone gets a portion of the combined cohorts external marks depending on your rank (except 1st and last who get highest and lowest respectively). So weaker students lower the total marks so everyone gets a lower assessment mark.
Someone want to correct me if I'm wrong?
You might be right but it's kinda hard to understand what you are saying.
From my understanding they calculate the externals average from the pool of marks of the HSC exams (from the cohort) and the internal average from the pool of marks of the internal Assessments(from the cohort).
If externals average > internals average: The moderated internal mark gets dragged up.
If externals average < internals average: The moderated internal mark gets dragged down.
Your EXTERNAL mark stays the same and is whatever you get (ie. it does not get dragged up or down). Your INTERNAL mark is what gets changed (moderated) by the process above.
First and last are exceptions to the above. Relative distribution of rankings are preserved.
That's my understanding of how it works, but I could too be wrong.