It is not surprising, given their intelligence, that cats were probably the first animals seagoing man welcomed aboard his vessels. Of course, there were lots of other creepy crawlies climbing in and out of the woodwork - worms, beetles, cockroaches and rats in the thousands. Cats - particularly the feral cats that were probably the first feline companions of humans - are frighteningly efficient hunters, and a boat full of nasties would have been just the place for them to do their thing.
The Egyptians are frequently credited with first bringing cats onto the water as hunters of geese and ducks, but I have my doubts. While punting on the Nile is nice for the nobles, it was the Phoenicians who first took to the sea as raiders of other nations and their ships. I would argue that they were probably the first to put cats on their ships to protect their prizes of grain, oil and so on. Rats and cockroaches can multiply without even thinking about it, but a gang of four or five cats can keep that problem relatively in check, even on a long sea voyage. Points for Tabby, even in my book.
During the Medieval period cats were considered evil. Burned at times, just like witches, they were thought of as an ill omen and a bringer of storms aboard ships. Note to the Dark Ages: cats aboard ships might have stemmed the tide of that pesky Black Death. Just a suggestion.
Cats were rehabilitated somewhat during the Renaissance but they really seemed to come into their own as the Enlightenment dawned. Most navies carried cats aboard ship routinely to keep vermin down and - sorry to say - as a source of food in particularly lean times. Virtually all pirates and privateers carried cats as the first animal they welcomed aboard. I know the monkey and parrot thing is cute and all but really, how many cockroaches and rats is Polly going to get rid of for you?
The ship's bosun, who was in charge of so much on navy, merchant and privateer ships, was also in charge of the cats. This added very little to his duties, really, because these guys were expected to feed themselves. They could easily jump onto the water barrel kept amidships to refresh themselves and cleaning up after them was part of the daily routine of swabbing the deck. Why the bosun was in charge of the cats is unclear, but it may have been a natural progression from looking after the cat o' nine tails kept for disciplinary purposes to keeping all the cats aboard. Who knows.
Just like the grog ration, cats lost their edge aboard ships in the 20th century. There were famously heroic cats from the navies of World War II but in the 1970s both the Royal Navy and the US Navy banned cats from ships for hygienic reasons. All these hundreds of years keeping the vermin down and you get booted for your hygiene? Human beings can be so ungrateful.
All the same there, Fluffy; I'd appreciate it if you'd stay off my lap.