In Year 10/11 it was someone who was generally consistent across maths/english/sciences etc.
In year 12 it was whoever had the most first places, our dux topped gen maths, english, ancient history, pdhpe and was third in bio and religion. But in the end she also had the highest overall ATAR...