The word for stealing writing began as the word for stealing people, and underneath that it was a net.
Etymonline and Merriam-Webster trace plagiarism to Latin plagiarius, "kidnapper." It comes from plagium, kidnapping, and from plaga, which meant a snare or hunting net. A plagiarius was originally someone who stole another person's slave or child, or who enslaved a free person.
The poet Martial moved the word onto books. He lived from about 40 AD to somewhere between 102 and 104, and he complained that other poets recited his epigrams as their own. PlagiarismToday reports that in one poem he called an unnamed literary thief a plagiarus. The joke was a comparison: the thief was like a man stealing Martial's slaves. PlagiarismToday adds that Martial seems to have cared more about credit and payment than about originality.
English took the word much later. Etymonline dates plagiary, meaning a literary thief, to about 1600, and Merriam-Webster notes that it kept the kidnapping sense at first. That sense is now obsolete. PlagiarismToday mentions a prominent theory that Ben Jonson used plagiary in 1601 for a copycat, but presents it as unsettled.
The abstract noun followed. Merriam-Webster's first known use of plagiarism is 1621, and Etymonline puts it in the 1620s, formed by adding -ism to plagiary. Plagiarist shows up in the 1670s and the verb plagiarize in 1716. PlagiarismToday adds that the word first appeared in a dictionary in 1755, about a century and a half after Jonson's use.
The metaphor is the lasting part. A word built on theft of a person now describes theft of words, and the older kidnapping meaning has dropped away.
The deeper roots remain uncertain. Etymonline says plaga is perhaps from an Indo-European base on the notion of "something extended," a variant of a root meaning "to be flat." De Vaan tentatively compares Greek plagia, "sides, flanks," and Old High German flah, "flat."