Piracy is an act of robbery or criminal violence by ship or boat-borne attackers upon another ship or a coastal area, typically with the goal of stealing cargo and other valuable items or properties. Captured crews and coastal populations may be ransomed, raped, enslaved, and/or killed.
A "privateer" or "corsair" used similar methods to a pirate, but acted under orders of the state while in possession of a commission or letter of marque and reprisal from a government or monarch authorizing the capture of merchant ships belonging to an enemy nation. Especially such piracy may be romanticized, such as by fiction authors from a state hostile to the state(s) often attacked by certain pirates.
Piracy is also an informal word for copyright infringement.