They sail back and forth in the ocean, and when Jim flies overhead on his Pocket Rocket, the pirate ships will immediately turn to face Jim, and fire cannonballs up at him. Even more annoyingly, they may try to fire on the balloon which Jim has to protect, and which is crucial to the mission.
Luckily, their cannonballs are fairly slow, and can be knocked off course with blasts from the Pocket Rocket, but can still prove difficult when the pirate ships are encountered in numbers.
Jim can destroy the pirate ships by getting in line with them, and firing on them from above with the Pocket Rocket. However, this will also open Jim to direct cannon fire.