During a slingshot maneuver, the planet and spacecraft draw close enough together for an exchange of energy to occur.