When I got my first home computer, in December of 1990, it came with a folder full of gifs, which the builders of the computer had included to show off its capability. They also included an executable file that showed nothing but an animation of a can of Jolt Cola spinning around. Unfortunately, my computer didn't come with a program to view gifs, so it wasn't until a decade later that I actually viewed them.
The point to this is that the .gif image format is very old, in computer terms. When we finally got computers and internet connections where we could use .jpg pictures, the .gif seemed hopelessly outdated. The animated gif was, to the internet-savvy, the sign of a newbie, or an annoying marketer. With the exception of Hampster Dance, the animated gif was a relic of the past.
Then, sometime around 2008 or so, something happened. For some reason, the animated gif made a big come back on the internet. In forums and other sites that involve threading or posting, animated gifs became a shorthand for whatever mood or attitude that the poster wished to convey. Many of these animated gifs were taken from popular movies or television shows, whereas others were just the stuff that bubbles to the surface of the internet. In other words, the typical animated gif features Doctor Who, Harry Potter or a cat doing something cute. But the internet's backlog of animated gifs is great, and some of them are quite artistic and unusual.
Why the animated gif became such a popular part of internet discussion is one of the vagaries of the internet. A probable answer is that as opposed to actual movie formats, an animated gif is much smaller, loads in a browser, and doesn't require supplemental software. Although I don't know if the animated gif is the best way for discussions to proceed on the internet, I have to admit that I find many of them to be useful and creative.