The pirate captain is the leader of a pirate haven.
If you talk to the captain, he will tell you that it's time to plunder and pillage. He will then ask which port his crew should attack, and you can recommend he attack one of the nearby European ports (but you can not recommend an attack on Indian villages, minor settlements, or other pirate havens). If you recommend an attack, than a pirate raider will sail out of the village. It will then sail to their target port, reduce its wealth, and return.
A common strategy is to attack the pirate raider before it reaches the port, and then sail there yourself and collect promotions for removing the pirate threat. This strategy does not adversely affect your relations with the captain, and he will not even mention it if you return.