I've been seeing similar gifs to this one all over G+ over the last few weeks, so I decided to post one on here to give an explanation as to what is actually happening.
What you see here is called a ferromagnetic fluid, or "ferrofluid". They are essentially microscopic magnetic particles that are spread throughout a solvent of some sort, like water, and are coated with materials that act to reduce the mixtures' surface tension. These coatings are known as "surfactants", and are there to prevent the particles from clumping together, making a "colloidal mixture".
After the ferrofluid has been made, it can be made to act in very interesting ways (as shown in the gif) in the presence of a magnetic field, because it becomes strongly magnetized. Then it can form different shapes, separate from larger groups, and do other very neat things depending on the force of the induced magnetic field it's being exposed to. These microparticles have such weak magnetic attractions between them that it's very easy to keep them from clumping, which is why you can see it changing shape in the gif so "effortlessly".
However, after the induced magnetic field is taken away, the ferrofluid goes back to its original form, because they do not retain the magnetization, so they can't stay in their new-formed shapes--without a constant magnetic field being applied to them.
More information on ferrofluids: http://en.wikipedia.org/wiki/Ferrofluid
Youtube video detailing this phenomena: Ferrofluid Sculpture
Ferrofluid uses, characteristics, and uses: http://education.mrsec.wisc.edu/modules/HighSchool/ferrofluid/Ferrofluids-Background.pdf