They use artillary in siege combat albeit a magic one so they should be somewhat familiar with concept of explosion.
Well they don’t even need knowledge about explosive they just need to know concept of traps and when to use them which was common since antiquity.