There's no definitive answer as to how hard one must work and so on... and going to a lower-ranked school doesn't automatically mean you can't get a good UAI as others have mentioned.
It's hard to answer the question posed by thecriclover99... but let me provide an example which I personally experienced.
I sucked at extension mathematics. I think I came around 110th? (out of 120 or so) people in Maths Ext 1, and I failed the school's internal assessments (bumming along around 24-25/50). However after moderation (ie. adjustments to the state- NOT SCALING) my mark became 39/50. I found maths extension bloody hard at school, and I was consistently performing very poorly in comparison to my cohort; but when it came time for the HSC exam, I did exactly the same as I think I would've done in my own school's assessments yet my exam result was much higher (40/50).
The point I'm trying to make is, when you're in a selective high school environment, you're view/opinion on how other students are performing in the subject relative to how you are performing can become very skewed- especially if you're at the lower end of the spectrum. Even if you work really really hard and feel you aren't being rewarded adequately, you really might not be doing so badly after all despite what your internal marks and rank would lead you to believe.
The other point I'm making is- it's not your school's name which leads to moderation of marks, but how your grade performs- that's why they say you want to go well in your internals, and you want your school to go well in the state-exams. You can't say it's "easier to get a good UAI in a selective school" because it isn't; ultimately, you still need to do well in a subject if you want it to count; but in a selective high school environment, what constitutes 'do well' might be difficult to gauge because of different/strict marking criteria to allow for greater differentiation between the top students; and if you are really really bad at a subject then no matter what school you're in, even JR, it's not gonna moderate up to a DA.