A script handles it. Each time you complete a quest, a check is made against the character's current level, and a set amount of gold is awarded based on a level-scale, e.g. 1-10 may get 100 gold, 11-20 may get 250 gold, 21-30 may get 500 gold (numbers random as I'm at work so cannot check the script for the precise values).