When the sling was added to the trebuchet it gave the tossed projectile more velocity. This meant the trebuchet could send a lighter projectile farther, providing more distance between those who fired the machines and deadly enemy archers at the castle.
Here's how it works. The sling lies on a track at the base of the trebuchet. As the arm of the trebuchet begins to move, the sling drags the ball before lifting it into the air. This gives the swinging arm time to pick up speed.
The sling is an extension of the beam's reach. At the time it is launched, the sling is actually moving faster than the beam, creating a whipping motion. A faster flung stone will deliver a stronger punch to the wall. With the extra velocity (which can be converted into a longer throw), the trebuchet can also be moved back to a safer distance from the castle wall.
There's an important catch, however. If a sling is used to extend the range of a trebuchet, a lighter ball must be used to reach the wall. The problem with a lighter ball is that it might not have the oomph necessary to destroy the wall.