Did some tests. It's not physical or magic. In fact, defense doesn't matter at all.
Barrel explosions do a set amount of damage. Amount probably scales based on level.
Tested each of these loadouts 3x each at Brigand Island lvl 35. Same damage each time.
The unit with the higher HP lost fewer soldiers.
641HP x 28 = 17,948 damage
491HP x 37 = 18167 damage
So the explosion probably does 18,000 damage at BI 35.