Scaling is to ensure that those who do difficult subjects are rewarded for doing them. Without it, a 80% in Mathematics Extension 2 is treated lesser than an 81% in General Maths. Now that's unfair.
So, scaling is done to ensure that those who do the difficult subjects are rewarded. In the end, I believe a 20% in Mathematics Extension 2 is treated on par with 80% in General.
Scaling is basically done by seeing how students fare in their other subjects, especially English. English is used as the measuring stick, hence it being compulsory and with constant scaling (I think).
So if all the 'smart' people did General Maths, and of course, aced Physics, Chemistry, and the rest of them - General Maths would be scaled higher. If the people who did General Maths also did Business Studies, Biology, and Music - and didn't do well in it, those three are scaled down.
Of course, there are trends. So, sciences and maths are scaled up, humanities are scaled down.
I probably wasn't clear - any questions, just ask them.