Current Meaning

Nowadays, fanfic or fan fiction is nonprofessional fiction written by the enthusiasts of a TV series, movie, book, or comic book, which takes place in that universe. It's usually dreadful — Sturgeon's Law applies here as much as elsewhere (see also Slash).

This usage is relatively modern, dating from no earlier than the 1970s. The previous usage was different in some important ways:

There were actually two kinds of fiction called "fan fiction"
1. SF written and published non-professionally by fans
2. Fiction (not necessarily sf or fantasy) written by fans about fans. This was sometimes called Faan fiction.

Original Sense #1: Amateur SF

Non-professional SF is of greater antiquity than sense #2, and the very earliest fanzines frequently contained this sort of fan fiction because fandom's first couple of decades were heavily focused on sf and many fans were focused on writing sf and breaking into the pro world. (And many succeeded.)

But still, the amateur sf printed in fanzines — usually put out by relative neofen — has generally been looked upon with disfavor because, with rare exceptions, if the piece were any good it would be published professionally. The problem id that people who write sf for fanzines generally learn little besides how to write bad sf for fanzines. The vast majority of active fans who've "gone pro" have been those who contributed relatively little fiction and a lot of essays and articles to fanzines .

Sometimes improperly used to mean fanscience fiction, that is, ordinary fantasy published in a fan magazine. Properly, the term means fiction about fans, or something about pros, and occasionally bringing in some famous characters stf stories. It may refer to real fans by name (Tucker nudged Brackney, who was nursing a "black eye"), or may be about types, especially Joe Fann. The background may be either fantastic, as Joe Fann into Space, or mundane as in Murder at the Chicon (tho this piece is fantasy under Speer's decimal scheme, describing events which we know didn't happen in our time-line). Fictitious elements are often interspersed in account of fan activities, which may make them more interesting, but plays hob with a truth-seeker like Thukydides. Round robins have been attempted in the fan fiction field.

(1) Sometimes meaningby fans in the manner of pros; that is, ordinary fantasy published in a fanzine. Properly, it means (2) fiction by fans about fans (or sometimes about pros) having no necessary connection with stfantasy. "Convention reports are a nice example of this", Bob Pavlat points out. It may refer to real fans by name: "Redd Boggssilped his Nuclear Fizz in the insurgent manner…" or it may be about types, especially Joe Fann". The background may be either fantastic, as "Joe Fann into Space", or mundane, as in "Murder at the Chicon" (tho this would be fantasy under Speer's scheme, since it describes events we know didn't happen on out time line). Fiction elements may be interspersed in accounts of fan activities, which may make them more interesting but is hell on truthseekers like your Thoukydides. A few special categories have been distinguished from time to time, like Ted Tubb's "Trufan fiction" (fiction about fans in fandom), and Larry Stark's Serconfanfiction for serious, and more or less mundane, fiction featuring fans.