Take a look at these snakes from Japanese psychologist and academic Akiyoshi Kitaoka
That is, TRY to take a look at these snakes:
They're not a video, and yet, they seem to shift and twist across the screen.
The short answer is: no one knows.
But, neuroscientists do have some clues as to why those snakes won't stop wriggling.
First, notice how the snakes never move when you're staring directly at them. This tells us that the movement is occurring in our peripheral vision where motion is king. Your peripheral vision struggles with colour and still objects but is highly responsive to movement.
That's why this type of illusion was called "peripheral drift" by Faubert and Herbert in 1999. (I think it is also the title of one of the Fast and Furious movies.)
Second, try to fix your eyes on the rotating snake in the very centre of the image. (It's harder than it looks.) When you do, the snakes stop moving. This tells us that the movement of the snakes is related to microsaccades, the tiny movements of the human eye.
Thirdly, these types of illusions tend to use a repeated pattern of high-contrast colours. Our brains process high-contrast images faster than low contrast images.
Notice how each blue dot has a white AND black shadow. Your brain processes the blue/white faster than the blue/black meaning you perceive the blue/black a fraction of a second later.
Seeing one image immediately after another causes a phi phenomenon. Our brain can't tell which image is which and we confuse it with motion. It's the psychological effect that makes movies, cartoons, and animation possible.
And that's about as far as the current research goes. We know that some combination of image processing latency, eye movements, and peripheral vision is creating the effect.
But exactly how they work together and why some shapes work better than others, is still a mystery.