Imagine you are looking "down" at the solar system. You have a planet moving in its orbit to the "left" at 10 km/sec. You have launched a probe from an inner planet so that it arrives at its perigee just a little ahead of the planet and traveling at 3 km/sec. From our viewpoint, both probe and planet are moving to the left. The probe is placed at just the right distance from the planet that it takes a parabolic orbit around it. From the perspective of the Planet, the probe falls in going left to right with a starting velocity of 7 km/sec, whips around the planet and ends up going 7 km/sec right to left when it reaches its starting distance again.
From our viewpoint, the probe ends up with a velocity of 10 +7 = 17 km/sec moving to the left. It has gained 14 km/sec without a net change in direction.