Teresa Nielsen Hayden, an editor at Tor Books, says there's no such thing as fan fiction really.
"Good fiction gets under our skin. It can change the way we see the world. But whatever its effect, it’s a significant experience. It would be a bizarre thing—unnatural, even—for writers to not engage with that experience. They always have. I could show you stuff centuries old—heck, some of it’s millennia old—that’s fanfic by any modern definition.
Of course, it would have to be a modern definition. In a purely literary sense, fanfic doesn’t exist. There is only fiction. Fanfic is a legal category created by the modern system of trademarks and copyrights. Putting that label on a work of fiction says nothing about its quality, its creativity, or the intent of the writer who created it.
The Pulitzer Prize for Fiction this year went to March, a novel by Geraldine Brooks, published by Viking. It’s a re-imagining of the life of the father of the four March girls in Louisa May Alcott’s Little Women. Can you see a particle of difference between that and a work of declared fanfiction? I can’t. I can only see two differences: first, Louisa May Alcott is out of copyright; and second, Louisa May Alcott, Geraldine Brooks, and Viking are dreadfully respectable.
I’m just a tad cynical about authors who rage against fanfic. Their own work may be original to them, but even if their writing is so outre that it’s barely readable, they’ll still be using tropes and techniques and conventions they picked up from other writers. We have a system that counts some borrowings as legitimate, others as illegitimate. They stick with the legit sort, but they’re still writing out of and into the shared web of literature. They’re not so different as all that."