As the balls on either end swing, eventually, the balls lose energy to many things. This includes air due to air friction, sound when they collide and finally heat upon collision. All of these factors take away energy from the balls until the kinetic energy and momentum are reduced to zero, which slows the balls down and makes them stop.