The ship is surrounded by pirates, and the only way to get out is to attack them. The pirates are out of range of their guns, so they're going to have to fight them off at sea. The only way they can do that is to shoot at them from the air, and that's what they do. They're not going to be able to do that on land, either, because the pirates are too far away to fire at them. So they have to board the ship.
The ship is surrounded by pirates, and the only way to get out is to attack them. The pirates are out of range of their guns, so they're going to have to fight them off at sea. The only way they can do that is to shoot at them from the air, and that's what they do. They're not going to be able to do that on land, either, because the pirates are too far away to fire at them. So they have to board the ship.