Pendulum Clocks Work
I spent considerable effort developing this answer. Once I was finished it and I had it posted I read the other answers. Fred Apstein has a very brief, and very well written answer. Nevertheless...
A pendulum clock uses a hanging weight attached to a rigid arm that points in the direction of gravity at the central point in the arc of the swing that is generated by the clock's mechanism. A detailed description of how a pendulum clock works can be found at the following web address:
The central point is that the arm, at that central point must point down at the centre of the earth (or thereabouts). In fact, if you move a pendulum clock it can affect its accuracy, since the gravitational force at the new location may differ from the original position. That is why the pendulum weight can be moved up and down the arm. And it perfectly illustrates how sensitive these clocks are.
As ships are immersed in sufficient water to be free to move, that movement will affect the clock. But more importantly, the point where the centre of the arc used to point will also be free to move so that the line from the centre of the clock to that point will not always be pointing at the centre of the earth as was assumed by the clockmaker. That will introduce significant errors, and was the primary reason navigation was such a difficult task prior to the development of the marine chronometer. If you are up to the challenge, lookup the famous carpenter and clock maker John Harrison sometime. He invented the marine chronometer.