I've done some digging, and considered Robotnik's comment and I believe what's happening is exactly what he said.
I've constructed a JSFiddle showing how it works (note that I'm sure SE does it a little more cleverly, but you get the point). You can see that in the JSFiddle, the animation continues if you move you mouse away from it and then back onto the image quickly.
Here is the actual CSS from inspecting the source:
background-image: url('img/mothership-lazers.gif?v=de6a0ef33c8b') !important;
background-image: url('img/mothership-lazers.gif?v=de6a0ef33c8b'),url('img/mothership.png?v=6ceca251c5e2') !important
Removing this bit of code causes the animation of the ask question button to not work at all.
Basically, when you
hover over the ask question button, it replaces the static image with the Gif below:
Thanks to this SO question for some tips!