Some great ideas here! I've got a few ideas, I'm pretty sure some of them are beyond what is going to be in the game, but I thought I'd share anyway.
There could be a faction trait that makes a larger percentage of the population take up arms when attacked, called 'strongly patriotic' or something. Same thing could be done for the sovereign, give him a talent like 'inspiring' that has a similar effect. Factions could also be 'militaristic', meaning more people have had some military training, giving better troops, and due to civilians owning weapons, stronger militia units. Ultimately, a militaristic, strongly patriotic, egalitarian faction led by an inspiring sovereign with high charisma would have a good advantage defending towns by spawning a larger, stronger militia when attacked.
There is no city morale or happinessmechanic in the game, and I don't think the dev's are planning on including it ATM, but it could have some nice effects if it was. A city with high morale would spawn more militia, and one with low morale less. So a strategic map spell that alters a city's morale would have an effect on combat.
The spawning of militia could depend on the strength and perceived intentions of the attacker. So if a necromancers undead horde attacks, intending to turn everyone into a zombie, the militia would fight. If there are no defensive units in the city, and a large enemy army of the same race attacks it, maybe the city just surrenders, hoping to only be occupied. Off course, if the city is then sacked the next town might put up more of a fight. And if an occupied city is attacked by a liberation force, maybe some militia are created inside the walls, hoping to drive off the occupying force.
Like I said, most of these things probably won't make it into the game, but maybe in an update/expansion/mod some day...