It's basically just taking a popular template or an image that expresses something to you, and putting a catchphrase or old joke on it - or maybe even writing something else that brings out the humor in some way.
It might require some pattern recognition to know what clicks and what doesn't, and sometimes even some lateral thinking to make a creative match between image and words, but it shouldn't take a really long train of thought.
In fact, sometimes it seems like the more well-thought-out a meme is, the worse it will do when you submit it. (That's my take on it, anyway.)