Why Gravitational Slingshots Are Used
A spacecraft traveling from Earth to an inner planet will accelerate because it is falling toward the Sun, and a spacecraft traveling from Earth to an outer planet will decelerate because it is leaving the vicinity of the Sun.
Although the orbital speed of an inner planet is greater than that of the Earth, a spacecraft traveling to an inner planet, even at the minimum speed needed to reach it, is still accelerated by the Sun's gravity to a speed notably greater than the orbital speed of that destination planet. If the spacecraft's purpose is only to fly by the inner planet, then there is typically no need to slow the spacecraft. However, if the spacecraft is to be inserted into orbit about that inner planet, then there must be some way to slow the spacecraft.
Similarly, while the orbital speed of an outer planet is less than that of the Earth, a spacecraft leaving the Earth at the minimum speed needed to travel to some outer planet is decelerated by the Sun's gravity to a speed far less than the orbital speed of that outer planet. Thus, there must be some way to accelerate the spacecraft when it reaches that outer planet if it is to enter orbit about it. However, if the spacecraft is accelerated to more than the minimum required, less total propellant will be needed to enter orbit about the target planet. Also, accelerating the spacecraft early in the flight will, of course, reduce the travel time.
Rocket engines can certainly be used to accelerate and decelerate the spacecraft. However, rocket thrust takes propellant, propellant has mass, and even a small added delta-v requirement translates to far larger amounts of propellant needed to escape Earth's gravity well. This is because not only must the primary stage engines lift that extra propellant, they must also lift more propellant still, to lift that additional propellant. Thus the liftoff mass requirement increases exponentially with an increase in the required delta-v of the spacecraft.
Since a gravity assist maneuver can change the speed of a spacecraft without expending propellant, if and when possible, combined with aerobraking, it can save significant amounts of propellant.
As an example, the MESSENGER mission used gravity assist maneuvering to slow the spacecraft on its way to Mercury; however, since Mercury has almost no atmosphere, aerobraking could not be used for insertion into orbit about it.
Journeys to the nearest planets, Mars and Venus, use a Hohmann transfer orbit, an elliptical path which starts as a tangent to one planet's orbit round the Sun and finishes as a tangent to the other. This method uses very nearly the smallest possible amount of fuel, but is very slow — it can take over a year to travel from Earth to Mars (fuzzy orbits use even less fuel, but are even slower).
Similarly it might take decades for a spaceship to travel to the outer planets (Jupiter, Saturn, Uranus, etc.) using a Hohmann transfer orbit, and it would still require far too much propellant, because the spacecraft would have to travel for 800 million km (500 million miles) or more against the force of the Sun's gravity. As gravitational assist maneuvers offer the only way to gain speed without using propellant, all missions to the outer planets have used it.
Read more about this topic: Gravity Assist