They have multiple charges. And there is a “killswitch” or “failsafe” of sorts.
So normally, the ninjas randomly select to fire at either 1x, 2x or 3x charges.
HOWEVER, they trigger immediately if (if possible) when they drop into “low HP” region.
Read more here: Ninja Changing when they Fire Special Skill -- Gone from 2x & Holding for 3x to "S" with no mana change