These images are called illusory motion, and curiously enough, there's still no solid explanation for them (there are strong theories, though).
Some visual scientists think it has to do with fixation jitter:
involuntary eye movements that give the illusion that objects near
what you're fixated on are moving. Others think that when you glance
around the image, motion detectors in your visual cortex get
"confused" by dynamical changes in neurons, and think you're seeing
For art, using black and white patterns (I'm guessing color is also ok, though not sure if it fits the definition) to create vivid illusions of motion is based on the concept of Optical Flow:
Optical flow or optic flow is the pattern of apparent motion of
objects, surfaces, and edges in a visual scene caused by the relative
motion between an observer (an eye or a camera) and the scene.
Op art, also known as optical art, is a style of visual art that makes use of optical illusions. Op art works are abstract and usually made in black and white. When the viewer looks at them, the impression given is of movement, hidden images, flashing and vibration, patterns, swelling or warping.
The effects are created through the use of pattern and line. The lines create after- images of certain colors due to how the retina receives and processes light. According to Goethe (Theory of Colours), at the edge where light and dark meet, color arises because lightness and darkness are the two central properties in the creation of color.
Color can also be used for the illusions, and there are three major classes of the interaction of color: simultaneous contrast, successive contrast, and reverse contrast (or assimilation). These are all explained very nicely in the Op art article. This site also has a huge list of illusions and they explain how each one is made or works.
I can't find guides for something like the images you posted, but it might be similar to the Rotating Snake, where totation direction depends on the polarity of the luminance steps.
Now, on how to make them. Apparently each illusion requires quite a lot of work. However, because there are some principles you can follow, there existing guides on how to create stuff like this:
How to Create a Moving Image Optical Illusion by PSDTuts
I think their explanation sums it up quite nicely: When we look at the image below, our brain tries to convert it from 2D to 3D. This is because the borders around the ellipses are inconsistent. This confuses us and creates an illusion of movement.
The final result for that guide will be an image similar to this:
While your images use a lot of color, I think the principles behind them are related to Op art. Well, at least they both use lines and patterns!