Random.

Pacify prevents stuff like (hard mode) Ifrit's Radiant Plumes, Eruptions, and Incinerate (fire breath).
It lands on goblin snipers in A2S but I don't know if it actually prevents anything.
It also works on the big scorpion guys (Sastasha hard first boss, A3 Normal) but doesn't actually prevent any attacks from going through.

So basically it's random. Magic isn't an indicator (thanks Ifrit), cast bar or lack of one isn't. It's just random. Whatever the devs flag as a weapon skill. It generally works on instant attacks though (those ones that basically just hit for like auto attack damage times 2), except when it doesn't like in the case of the scorpion guys.