Minecraft wiki entry for Zombie_Villager, associated text: if the new item is armor or a sword and the old item was not (for example, zombie villagers prefer swords to pickaxes and helmets to pumpkins),
if both items are armor/swords and the new item is better damage-wise (reduces more damage for armor, or inflicts more damage for swords),
if both items are armor/swords with the same damage reduction/infliction, the new item has NBT tags while the old does not or the new item is more damaged than the old item, or
if both items are bows and the new item has NBT tags while the old does not.