In the attached diagram it is possible to observe as a free-body diagram, the forces acting on the pendulum. One of the Forces that reverberates on this, is the force of gravity, and the same that is responsible for giving the weight value to the mass that hangs on the rope.
If this force acted without having the effects of energy loss by rotation, the pendulum would be in perpetual oscillation. In turn, this gravitational force is the same that is responsible for accelerating and decelerating the pendulum.