The concept of fan fiction is surprisingly not as new as you might think–for instance, many of Shakespeare’s plays were based on stories by other authors of his time, and in the 19th century, pastiches and ‘unofficial sequels’ to well-known classic literature (such as stories about Sherlock Holmes that were not authorized by Arthur Conan Doyle) were not unheard of. But the modern-day definition did not truly come into effect until the latter half of the 20th century, when Star Trek fans began publishing fanzines (unofficial publications created by fans for other fans’ enjoyment). In fact, it was one such fanzine, Menagerie, that contained the story “A Trekkie’s Tale,” a satire of works featuring idealized female characters and consequently giving rise to the term ‘Mary Sue,’ (named for the protagonist of the aforementioned story).
The rise of the Internet caused the popularity of fan fiction to skyrocket, leading to the creation of fan fic archive sites and later on, to a subset of doujinshi (independently published Japanese comic books AKA manga) based on various franchises. In addition, some fanfics eventually became ‘official’ works all their own–for example, Fifty Shades of Grey was originally a Twilight fan fic, though the author changed the characters’ names to avoid copyright issues. There are even fanfics that have inspired fanfics of their own, often becoming part of a fan universe.