Pirates had to work together to successfully plunder and rob.
The average old-timey Caribean-type pirate ship during the 17th and 18th centuries consisted of 80 pirates, and some pirate crews reached into the hundreds.
But pirates were not known for being the most orderly people.
How did ruffians who thought nothing of murder work together to relieve massive armed merchant vessels of their goods? And how could one pirate be sure his hard work wouldn't simply be stolen by a rival, or expropriated by the Captain?
Carribean piracy was effective and profitable, in short, because they formed an effective legal system. Pirate ships were like tiny floating governments.
And while pirates were clearly horrible to outsiders, internally, they actually had a fair and efficient system of governance.
Each ship would put together their own set of rules or articles. These essentially formed the government aboard each ship.