Let me explain – Defense affects the amount of damage that will be dealt to a unit. I saw a map where a Barbarian with stats (50 50 0 0) and combat skills fought against a Mage (0 0 50 50) with magic skills (they were without artifacts). Their armies were equal to 6 city growth levels. In the battle, when the Mage cast an expert-level explosion on the raiders, very few of them were destroyed (I don't remember exactly, but not more than 40). And this is a level 2 unit. What an amazing Mage with his spells....
Defense reduces damage by 2.5% for each defense advantage.
That is, the reduction will be defense minus the attack of the attacked unit * 2.5% (if the defense is greater than the attack).
If it's less, then it's 5%.
And it doesn't affect damage from magic.
The damage from the explosion is equal to SP*75+300 for the expert level.
That is, in the given example, Damage = 50*75+300=4050
The raider's health is 10
The number of raiders killed is equal to 4050/10=400
You've got something mixed up, IMHO.