Up until recently I'd suspected it was unit size compared to the number of defending peasant militia. But now I'm not so sure after having a character leading 120 soldiers being unable to loot. Maybe it could have something to do with the type of looting? That's something I haven't investigated.