the atar is a rank from 0 to 99.95, made from an agrigate of scaled subjects. The maths behind how the atar is calculated is complicated statistical analysis. raw marks from internals are used to make ranks for internal assesment tasks. the hsc is used as a sort of scaling tool to rank schools against eachother, to even out the difficulty difference between differnt school internal assesment tasks, so technically, the hsc is the only thing that matters. The raw hsc marks are aligned with a linear transformation, setting the worst mark as 0 and the best mark at 100 (this is the aligned mark, the one they put into atar calculators and the one you see when you get the atar, also the one from the raw mark database). From the scaling report, they take these marks and put them all with a mean of 25/50 and a standard distrubution of 12 and then they combine it with moderated internal assesment marks, keep in mind i barely know what is going on and some of this might be wrong. Using the moderated internal assesment tasks, ranks are formed and the raw mark from the hsc is half matched to your rank. Lets say if joe got 100% but came last internally, he would only receive half of his 100% from the hsc and the other half comes from the worst mark in the hsc. The hsc basically justs gets everyone's scores and distributes them. The aligned marks are then scaled so that the difficlty of the tests can be accounted for, dont want a guy from dance getting 50% being equal to a guy getting 50% in 4u maths. These scaled marks are then converted into an atar equivilant to make an aggrigate out of 500 that is used to rank people. i suggest reading
@carrotsss atar scaling report with his atar calculator. Nobody really knows how it works.