Pirates sanctioned by the Government? Sounds like something manga invented.
But the One Piece fact is, most of the real pirates you know were actually privateers–pirates sanctioned by the Government. Henry Morgan (the guy on the rum bottle) was one, Blackbeard began his career as one, and the famous Sir Francis Drake were all, basically, Shichibukai.
Privateers were pirates the government hired to attack, loot, and plunder other countries’ ships. And they were very good at it.
The epic Whitebeard war, where the Shichibukai fought alongside the Marines–that stuff actually happened. Privateers were often more skilled at naval warfare than the actual navy, and were called into battle to defend the mother country in times of need.
Remember how during the war Blackbeard, a Shichibukai, betrayed the Government? Well, that was real too.
Some privateers, like the real Blackbeard, backstabbed the Government and decided to attack, loot, and plunder whoever they wanted.