Speculation warning!
I think Defense (or wathever it's called, the one with the shield icon) works for both physical and magical attacks.
Let's say I cast a fireball, I have 10 int., so 10 damage max, my attack roll is something between 1 and 10.
My target has 20 Defense, he rolls between 1 and 20.
attack roll - defense roll = damage.
If you do zero damage the game tells you you missed... which is confusing.