Plagiarism, while not necessarily a crime, is still a tort.
Somebody wiser than I once said that stealing from one is plagiarism, while stealing from many is research.
So was George Lucas putting his own byline on ADF's anonymously ghostwritten novelization of the first SW movie plagiarism? ADF doesn't seem to think so: he'd simply been hired to turn Lucas's screenplay into prose.
What about the ST "Autobiographies"? Hardly. Kirk, Picard, and Janeway are fictional characters. They can't write anything in the real world, and nobody has any reasonable expectation that something labeled as The Autobiography of James T. Kirk would be anything other than a work of fiction, written entirely by its purported "editor."
What about the Reeves-Stevenses co-writing the "Shatnerverse" novels? No; they're acknowledged as co-authors with Shatner, and their own description of the process, as I recall, is that it's his story, his ideas, and all they did was turn them into comprehensible prose.
What about Edward Stratemeyer passing story outlines to young writers, hungry enough to anonymously ghostwrite for a paycheck, and then publishing the resulting children's novels under such pseudonyms as Laura Lee Hope, Franklin W. Dixon, and Carolyn Keene? That gets a bit stickier, because for many years, most people weren't aware that the purported authors of those books were themselves fictional characters, and it wasn't until James Keeline published a web site on the pseudonymous works of the Stratemeyer Syndicate that the identities of the ghostwriters became readily available to the general public.
I will also note that some universities and colleges will treat certain types of academic fraud as "plagiarism" even though it is not. Turning in the same paper for credit more than once, if not done openly and with the full informed consent of all the professors involved, may be fraudulent, but so long as it is entirely one's own work, it cannot meet the strict definition of plagiarism (and in some cases, e.g., using a class in term paper writing to write a paper for a science or history class, should be actively encouraged, so long as it is done openly, because the close supervision the student receives in the writing class almost guarantees that the student cannot get away with even a "custom job" from a term paper mill. And neither should a student be penalized, much less accused of plagiarism, for submitting a paper based on his or her own prior work (again, so long as it is done openly): when I took my semester of term paper writing at CSU Long Beach, Dr. Bell did a presentation, as I recall, on how one of his high school papers ultimately evolved into his doctoral dissertation, and encouraged us to do so (in my case, the paper I wrote for that class was an extensively revised and expanded version of a sort of "computer literacy manifesto" I'd written a year earlier, when I took term paper writing in my senior year of high school).
Which is to say that I have, since the second semester of my freshman year at CSULB (a few months shy of 41 years ago, and I still have my MLA Handbook), strongly believed that a closely supervised class in term paper writing -- accompanied by an institution-wide rule that double-counting papers written for that class must always be acceptable, so long as it is done openly -- should be an absolute requirement that can no more be challenged or "tested out" of than, say, the required semester of U.S. Government, and that such a requirement is the best defense against term paper mills: it replaces fear of the work involved with appreciation of the work involved, and builds the skills to do the work involved.