They surrender when they're on low morale - so when they have repeatedly lost battles, when they're low on food (which you can see in the siege scree, how many days left until starved out)...
Very rarely worth doing, easier to just smash their heads in.
As to how to change it I'm afraid I don't know.