The dices are compared one by one from the highest score to the lowest.
The highest attacker's dice is compared to the highest defender's dice, then the second highest dices are compared and so on.
Example 3 vs 1: Attacker has 6, 4, 3 Defenders has 6 The attacker loses one army (6 vs 6).
Example 3 vs 3: Attacker has 6, 4, 3 Defenders has 5, 3, 3 The defender loses 2 armies (6 vs 5; 4 vs 3) and the attacker loses 1 army (3 vs 3).