Pirates will occasionally appear in the game. The pirates are separated into individual gangs, and each gang has a hideout. A hideout can only be found if your convoy sees pirates leaving it or returning to it.
Pirate convoys hunt weak trading vessels, looting them then returning to their hideout. Every successful raid increases this gangs power. Their convoys are distinguished from other convoys by the black sails.
Having fully armed and manned convoys help ward off early pirate attacks. But they will still slowly gain power. So it is important to at least destroy their main convoy. If you are adept at manual fights and have a strong convoy, it is a good idea to farm a pirate hideout for cheap ships.