Many months ago in a thread I can't find, there was a discussion on how this worked at the time. Short version: it works like it does in Galciv 2. (Or it did back then, it's entirely possible it's been totally changed.)
Longer version: Defense is not dodge, it's mitigation. Attacker does a roll between 0 and their attack stat. Defender rolls between 0 and their defense stat. Damage done is Attack Roll - Defense Roll, or 0, whichever is greater.
So a unit with Attack 5 hitting a target with Defense 10 could do 5 damage. It could do 0 damage. It could do anything in between. Most of the time it will do minimal damage, and if the defender roll is >= 5 (which it will be about 50% of the time), the attacker will do 0 damage.
Damage types don't seem to be in the current version, but they are scheduled to go in. That will mix things up some.
In regards to the examples above, a high attack/0 defense unit will pulverize other units, but also get pulverized in return. A 1 ATK/1 DEF/5 HP peasant can damage it, but will probably die in one attack. 50 of them will win the day though, simply due to their ability to inflict damage faster then the attacker can pick off each peasant.
Conversly, a 0 ATK/high DEF unit would still lose to the peasants as it could never kill any of them, but it'd take a very long time since it would only ever take damage if it rolled a 0 on its defense roll AND that peasant rolls 1 on its attack roll. A 1 ATK/high DEF unit would almost certainly slaughter the peasants due to its much higher chance to inflict damage. (As the peasant only has two possible defense rolls, you'll see zero a lot more often.)