It's a question of not knowing the neighborhood (not that anyone cruising could be unaware of the Samali pirate issue).
You play the odds every time you cross a street or untie the lines. Some places are safer than others. The article said they "left the Seychelles on Thursday, heading for Tanzania via the Amirante Islands". Map it. Was that far enough from Samalia? Apparently they thought so but were wrong.