Naturally, different units will have different statistics that can also benefit the player in the combat. These include tactics of movement, attack and defence. While any one-unit attacks, it deals with the damage.
The damage that has been dealt with depends on both the attack statistic of the attacking unit and the Defence statistic of the defending unit.
So, if the defending unit is somehow left alive and the attacking unit is well within its attacking range, then the calculator will deal with retaliation based on its defence statistic. This is regardless of the defence statistic of the attacker.
If sadly the defending unit gets killed, then the attacker will not suffer any consequences as such.