I'm not a sailor, but I've heard of this before. A flock of birds gets lost at sea, especially in fog or during a storm. They see a boat and it's the only thing they can settle on for a rest. Some continue flying, looking for the way home to land, but eventually they start dying from exhaustion. Finally some of them might spot land and fly off (or might just get confused and further lost at sea) and the rest of the surviving flock follows.