It's completely random

Roughly though it's about a 20% chance they do the special.

Just to make sure you know, if they do the special attack they don't also do their normal attack. So their special effectively replaces their regular attack on that tick