Every action that can cause damage has its own Damage Type which can influence the amount of total damage dealt.
Physical damage is the most common type of damage, caused by most Weapons, and a large number of Skills. A physical attack will always target the enemy's DEF stat. Note that if a skill states that it performs or counts as a Regular Attack, it will use the damage type of your equipped weapons, even if the ability otherwise states it deals physical damage.
A unit cannot have resistance or weakness to physical attacks.
Magical damage is dealt by a few Abilities (mostly Spells). A magical attack will always target the enemy's RES stat.
A unit cannot have resistance or weakness to magical attacks.
Elemental damage is dealt by a variety of Abilities and a few Weapons. Elemental damage can target either DEF or RES depending on the ability used. A Regular Attack with an elemental damage type will always target DEF.
Elemental damage comes in six types: Water, Fire, Earth, Thunder, Dark, and Holy. A unit can have resistances or weaknesses to each element. Various Equipment offers changes to elemental resistance, and Monsters and Monster Classes have innate resistances and weaknesses to specific elements. For example, Vangals have an innate -50 Fire resistance.
Each point of Elemental resistance reduces damage taken of that element by 1%, while a negative resistance increases damage taken by 1% per point. So if a target has 50 Water resistance, they would take 50% less damage from Water attacks and abilities. At 100 resistance, the target is immune to that damage type. A unit can have over 100 points of resistance, in which case they are healed 1% of the damage per point over 100. So if a target has 160 Thunder resistance and were hit by a Thunder attack, they would be healed 60% of the normal damage. Note that even at over 100 resistance, a unit will still try and avoid the attack as normal, and use Counters when applicable. Debuffs caused by the attack will also be applied, even if the target is healed.
Elemental resistance provides no additional benefit when higher than 200, and cannot go lower than -150.