Number of enemy troops determines maximum number of loot. This is then I believe modified by looting skill.
Then party members and allies if any take their share of items to which they are entitled. I don't actually think game will do it physically, rather it will simply subtract from maximum number of items. This will result in to how many items will actually appear on the looting screen.
Then game will randomly generate these items based on the type and number of the enemy troops killed or captured in the battle.
So let's consider example: you alone against 5 looters, all killed or captured:
5 looters can give let's say 5 items each -1x headgear, 1x boots, 1x bodyarmor/dress, 1x primary weapon, 1x secondary weapon. That gives 5x5=25 items total.
Your looting skill is 2 which means +20% resulting in 30 items.
Since you fought alone without other party members, you are entitled to all 30 items. Game will randomly generate each based on the equipment looters can have and will present them to you on a looting screen.
Now consider same situation but now you fight along with 10 troops. Again, game will determine that maximum loot is 30 items but since your troops are entitled to 1 share each while you are entitled to 10 -meaning 10/10 share balance between you and your troops, game will randomly generate and then offer you only 15 items (half of maximum).
If you would fight with 20 troops, your share would be just 1/3 of the maximum that means 10 items.
...now this might not be 100% accurate since I did not see actual code, but it should give you idea.
Also note that companions are entitled to more then common troops (if I remember right: player 10 shares, companions 5 shares each and common troops 1share each).
Bottom line is that more enemies killed or captured, larger the loot. More troops and companions in your party as well as allies if any, less of that loot will you get.