It is a reference to Bismarck's cat which survived the sinking Bismarck, HMS Ark Royal and HMS Cossack before living its life in Gibraltar. It can be said that the cat was an bad luck charm for the vessel it resides in
Well it is a black cat... But there are other sayings like black cat isn't a bringer of misfortune but rather a warning sign that events of misfortune might be near.