That is a very useful application that allows us to use pendulums as the basis for time measurements!
Pendulum motion is an example of the conversion of potential energy to kinetic energy, and back again. Although frictional forces gradually slow a pendulum in the sense of decreasing the length of travel, the TIME that any particular length/mass of pendulum takes to swing from one side to the other is CONSTANT.
At the start of a cycle, the pendulum is raised, and thus has a particular potential energy defined by the gravitational constant and the mass of the pendulum. When it is released, this is converted to kinetic energy as it falls. This is "conserving" the energy of the system.
Being fixed by a rod or cord this creates an arc instead of a straight drop. At the bottom of the swing, the pendulum cannot release any more potential energy because it cannot drop any further. But the kinetic energy produced by the fall continues to propel the pendulum up the other side of the arc. It loses kinetic energy while it does that, regaining potential energy.
At the top of that side of the arc, the process repeats itself. Due to frictional losses this cannot be a "perpetual motion", and it will gradually slow down until it stops unless an external force pushes it back up to its original starting position.