The story
A reference to a wooden ship being pounded heavily in stormy seas to the extent that its timbers shake, causing awe and fear to the sailors on board.
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: A mild oath expressing surprise, disbelief or annoyance, stereotypically regarded as being uttered by pirates. Full definition →