First there was “Star Trek,” the original series, whose viewers—many of them women in STEM fields—organized conventions and created self-published journals (a.k.a. fanzines) with fiction about its characters, a small but notorious slice of which included sexy doings between Kirk and Spock. Or: first there were fans of science-fiction novels and magazines who held conventions and traded self-published journals as early as the nineteen-thirties. Or: first there was Sherlock Holmes, whose devotees, hooked by serial publication, pushed for more stories, formed clubs, and wrote their own. Or: first came Virgil’s Aeneid. Or: first, the Janeites. Or: first there was you, and your friends, age ten, making up adventures in which Chewbacca met Addy Walker, and writing them down.

However it started, however you define it, and whether or not you read it, at this point you’ve probably heard of fan fiction (abbreviated as “fanfic” by its enthusiasts). The advent of the Internet, where anyone can distribute text for free, and the arrival of such all-ages pop-culture juggernauts as Harry Potter, have together meant that the amount and the availability of fan fiction—narrowly defined by Francesca Coppa, in her new book, “The Fanfiction Reader,” as “creative material featuring characters [from] works whose copyright is held by others”—has grown spectacularly in the course of this century. So has its reputation, both because all things geeky, science-fictional, and fantastic now carry less stigma (or more cachet) and because authors with fanfic backgrounds have hit the big time. E. L. James famously converted her online “Twilight” novel, “Master of the Universe,” into the 2011 blockbuster “Fifty Shades of Grey” by removing names, vampires, and anything else that might infringe a “Twilight” copyright, a move known in fanfic circles as “filing off the serial numbers.” (She also removed the earlier text from the Web.) Fanfic itself is now a recurrent subject for professionally published novelists: Rainbow Rowell’s fun “Carry On,” published in 2015, was, in her words, “inspired by fictional fanfiction of a fictional series” described in Rowell’s earlier novel “Fangirl.”

A couple of years ago, Anne Jamison, a professor at the University of Utah, published a spectacularly useful study called “Fic: Why Fanfiction Is Taking Over the World,” written together with contributors from many fandoms and published by a small press. Jamison’s volume topped a stack of earlier books and essays by “aca-fans” that explained fan practices through one or another academic lens. Some focussed on homoerotic pairings (“slash,” from the virgule in “Kirk/Spock”), others on how amateurs built their own institutions, others on particular fandoms (“Buffy the Vampire Slayer,” say, or One Direction). The people who wrote these books and articles were anthropologists, psychoanalytic feminists, British-style cultural-studies types, legal scholars, and, more recently, literary critics, like Jamison (she is also a Kafka expert). All these scholars investigated the social, emotional, and aesthetic goals that fanfic, and sometimes only fanfic, can meet.

That stack of books did not, however, contain much actual fan fiction: a printed collection of the stuff, from a university press, with no serial numbers removed, would likely have been impossible as recently as five years ago, because the corporations that own Buffy, or General Leia, would have threatened to sue. They might have lost, if they did, on fair-use grounds, but the threats were the point; many copyright holders sought to control the way their properties circulated and to keep any money those properties made. (Some of those corporations now regard fanfic as free advertising instead, or else they’ve just given up: the Web is too big.) Absent those threats, the enormous amateur communities that now surround much fan fiction—with their solidarity, their infighting, their sometimes baroque memes and tropes (yuletide, femslash, drabble, gen, “imagine”), and their norms of online publication—would never have come into being, since they evolved to evade copyright claims and to deflect the legal and reputational dangers in writing and publishing sexually explicit work.

Part of that evolution was the birth, in 2007, of the online fanfic depository called Archive of Our Own, or AO3; it has become the go-to source for many kinds of fanworks. (That latter term includes things other than fiction: songs, for example, and comics, and remixed video.) AO3 is an “affinity space,” where people can work together on the basis of common goals and tastes, without direct institutional validation or material reward. It is fan-run, collective, and deeply anonymized, with a robust nonprofit (the Organization for Transformative Works) behind it. For all of those reasons, it promised stronger resistance to legal challenges than its for-profit competitors, and its precursors (such as the sprawling fanfiction.net), could provide.

Coppa, a professor of literature and theatre at Muhlenberg College, helped start AO3. Her “Fanfiction Reader” bundles stories that she regards as good on-ramps to the phenomenon: relatively short works set in well-known U.S.- or U.K.-based universes, with some sex but nothing ultra-kinky. Coppa has also written short, accompanying essays about the topics that the stories cover. All the stories are easy to follow, even if you don’t recognize the characters; most are thoughtful, and delightful. One “Star Trek” story imagines an alien species with “taboos about food and eating” comparable to our own taboos about sex: “You—you masticator!” a cadet from that species screams at Lieutenant Uhura, while “backing away in revulsion.” That story, “Lunch and Other Obscenities,” by the author known as Rheanna, could easily have been converted into a non-“Star Trek” piece for a science-fiction magazine. But then it would lose all the in-jokes, and half the fun.

The interesting question at this point is not whether fan fiction can be good, by familiar literary standards. (Of course it can; cf. Virgil.) Rather, it’s this: What is fan fiction especially, or uniquely, good at, or good for? Early defenses presented the practice as a way station, or an incubator. Writers who started out with fanfic and then found the proper mix of critique and encouragement could go on to publish “real” (and remunerated) work. Other defenses, focussed on slash, described it as a kind of safety valve: a substitute for desires that could not be articulated, much less acted out, in our real world. If women want to imagine sex between people who are both empowered, and equal, the argument ran, we may have to imagine two men. In space.

It’s true that a lot of fanfic is sexy, and that much of the sex is kinky, or taboo, or queer. But lots of fanfic has no more sex than the latest “Spider-Man” film (which is to say none at all, more or less). Moreover, as that shy proto-fan T. S. Eliot once put it, “nothing in this world or the next is a substitute for anything else.” It’s a mistake to see fanfic only as faute de mieux, a second choice, a replacement. Fanfic can, of course, pay homage to source texts, and let us imagine more life in their worlds; it can be like going back to a restaurant you loved, or like learning to cook that restaurant’s food. It can also be a way to critique sources, as when race-bending writers show what might change if Agent Scully were black. (Coppa has compared the writing of fanfic to the restaging of Shakespeare’s plays.)

Fanfic can also let writers, and readers, ask and answer speculative and reflective questions about our own lives, in a way that might get others to pay attention. What will college be like? What should summer camp have been like? How can an enemy become a friend? Should I move to Glasgow? What would that be like? Buffy Summers, in the story Coppa chose for her book, “has a soft spot for any story about the way her life should have been.” Don’t we all? If you’re a Buffy fan, you, too, might want to read Buffy’s ruminations; unless I am Alice Munro, or John Lewis, or Buffy herself, you have fewer reasons to read mine—and fewer still to follow some characters I just made up, in a town, or a planet, that I have to build from scratch.