Fanfiction is a popular genre of writing that became mainstream during the early 90's, with the advent of the internet.
Fanfiction, orfanfic for short, is when writers take popular properties (comic books, literature, film, and TV shows are all common choices) and write their own takes on them. Fanfiction usually contains a measure of wish fulfillment, wherein the author will insert an avatar character (similar to a Mary Sue) into the story, so that the writer can interact with the characters they enjoy so much.
Fanfiction was once of the most popular and one of the first forms of artistic communities on the web, until the internet became able to transmit pictures and video and before the advent of social media. You can see plenty of examples of fan-fiction at the central hub of all internet fanfiction at Fanfiction.net.
Some of the most common types of fanfiction are crossovers (where different characters from different properties interact) and romantic fiction (often creating pairings that never happened in the original story or much more erotic pairings). The term slash fiction, which describes a homosexual relationship in fanfiction, comes from the slash used to describe a story. For example, Harry Potter/Draco Malfoy, Xena/Gabrielle, and Superman/Batman are all common slash fiction pairings.
In today's literary world, and in previous centuries as well, fanfiction has developed into being a publishable exercise, thanks in part to the NYT bestseller Pride and Prejudice and Zombies, which can pretty much be considered Jane Austen fanfiction. However, the term fanfiction also has a negative connotation in book reviews. Normally, the remark means that the work is too derivative of its original source or just copies another source and changes the names. It probably also has the previously mentioned avatar problem.
The internet gave fanfiction its mainstream place in the literary world, but that doesn't mean everyone has to like it. (It was some of my very first writing, so I don't mind it. And if you wanted to know, it was X-Men and Avengers fanfic.)