How to predict when Jack-in-the-Box zombies are about to explode in endless survival?

These zombies are pretty easy to kill, only it seems that sometimes they explode prematurely and take down a whole bunch of plants.

So what are the signs that they are about to explode and what triggers explosion?


I believe their explosion is entirely random at each step. However, you know that they are about to explode because they stop a moment before and have a startled look on their face.


If you hit a lot of damage to them, they will explode much later. And they stop before it explodes