A pendulum is something hanging and swinging freely from a fixed point. A grandfather clock might use for timekeeping a pendulum that swings back and forth.
Pendulum comes from the Latin word pendulous, meaning "hanging down." If someone hangs a pocket watch in front of you and swings it back and forth, saying, "You're getting very sleepy," they're mimicking the movement of a pendulum. We also use the word pendulum to describe a situation moving between two poles or across a spectrum, like the balance of power in a multiparty political system.