The effect known as the gravity assist or slingshot effect is a way of using the motion of a planet to accelerate a space probe on its journey towards the outer planets.
Jupiter is not stationary! It is moving in its orbit around the Sun at about 48000 km/hr. As it space probe moves towards the planet it will accelerate as before but because Jupiter is moving it is “dragged along” by the planet, having its speed increased considerably by the planet's motion. Its speed after the encounter is much greater than it was before.
Please note that the distances, sizes and times of revolution of the planets and Sun are not to scale.