Defense
Defense or Def is one's ability to avoid mêlée damage, casted damage, or effects that depend on an attack rating for success. The chance of avoiding damage is in your favor if you are attacked with an attack rating that is lower then your defense rating.
Formula
Defense can be calculated using the following formula(1):
Defense = ((Dexterity*2) + (Total Armor Defense*(Armor Skill * .03)) + (Shield Armor * ( * .03)) + ((Primary Weapon Skill + Secondary Weapon Skill)/2)) * (1. Stance Modification)
Hit Roll
Regardless of one's defense or attack rating, there is a five percent chance of success for every event. This is known as the hit roll.
References
1. Defense formula: Conformed Game Formulas (UBI Forum)