Meaning "one who takes another's work without permission" first recorded 1701; sense of "unlicensed radio broadcaster" (generally transmitting from a ship outside territorial waters) is from 1913.
pirate (v.)
"to rob on the high seas; commit piracy upon," 1570s, from pirate (n.). By 1706 as "appropriate and reproduce the literary or artistic work of another without right or permission; infringe on the copyright of another."
pirate (n.)
Meaning "one who takes another's work without permission" first recorded 1701; sense of "unlicensed radio broadcaster" (generally transmitting from a ship outside territorial waters) is from 1913.
pirate (v.)
"to rob on the high seas; commit piracy upon," 1570s, from pirate (n.). By 1706 as "appropriate and reproduce the literary or artistic work of another without right or permission; infringe on the copyright of another."
-- https://www.etymonline.com/word/pirate
sadly it doesn't explain the how of the word coming about.