It’s no secret that in literature we see characters that remind us of other characters. Furthermore, it’s no secret we see plots that remind us of other plots.
For example, an author reads Book A and decides to model the main character in his novel, Book B, after the main character in Book A. Is he alluding, plagiarizing, or neither? The same question goes for plot as well.
To give some flesh to this example, consider the case of Romeo and Juliet. Shakespeare, although he did include elements of his own, borrowed from prior written works. Do we give Shakespeare a pass because of his brilliance? Perhaps the conduct I’ve described isn’t unethical.
Where do we draw the line?
Answer
We don't. It's a blurred line and a fortune in legal costs on arguing where it lies.
Of course there is a classification, but the lines are always blurred.
On the "white side" there's alluding - when you make your own characters, but draw specific parallels, exploring what-if's of the other work, mocking its shortcomings, or referencing its most brilliant elements. Example: "Space Balls" heavily alludes to "Star Wars", often parodying its elements.
There's also drawing inspiration. It's where you take some of the concepts, but modify them deeply enough to make your story entirely original. Example: "The Lion King" was inspired by "Hamlet".
The gray area has referencing and pastiche. Referencing is when you copy concepts of the original, nearly verbatim, but apply a twist deep enough to create an original story. It may or may not be legal, it may fall under fair use, or be treated as a derivative work. Example: "The Last Ringbearer" is "Lord of the Rings" retold from perspective of the Orcs.
Another gray area practice is Pastiche. It's purposeful, deliberate copying of one's style, up to and sometimes including forging the signature. Since style can't be copyrighted, it's technically legal... in most cases. In art, "discovering" a "lost" Van Gogh painting will be treated as full-scale crime, even if the forgery isn't a copy of any existing Van Gogh painting, merely a pastiche of the style. Sometimes it's a parody (and then protected as fair use), but sometimes it's serious. Example: Dave McClure's poem "The Traveler" is a pastiche of Edgar Alan Poe's "The Raven".
Then there's the dark area of plagiarism, where not enough original thought was put into the work to set it apart as unique, and outright piracy where all pretense of authorship is dropped; only revenue is redirected.
But again, how little referencing is merely drawing inspiration - or how much is plagiarism - this is not firmly defined.