Not sure if true, but I heard that for courses like medicine, where more than a high ATAR is needed, they actually take these things into consideration.
please don't shoot me if i'm wrong!

And PERHAPS if you're in the middle band, and there's one spot left with 2 people of the same ATAR then maybe that would be taken into consideration?
Let's say you're doing a maths heavy course and let's say a 35 in methods is a prerequisite, then I think if one person got 40 on the first attempt, another got 40 on the second attempt, they'll be likely the choose the former...
And once again, just another assumption.
Is it the higher raw score or scaled score that's counted?
Raw scores are only considered if you intend to do a course which has certain prerequisites ie a 25 in English.
Scaled scores are added to form an aggregate which will determine your ATAR.