Part of it is knowing where the accented syllable(s) go and part of it is that the spelling doesn't indicate the pronunciation in some cases, e.g. Awaba in the Lake Macquarie area is pronounced UhWOBBuh.
It's a bit of a local (Newcastle or mid north coast) joke that Bulahdelah, which is pronounced BULLuhDEEluh, is deliberately mispronounced as BullARdellAR.
I could go on, but I won't - until I remember which place the TV presenter mispronounced last year.