This is the way of thinking about it that works best for me. As you fall into the gravity well of the planet from behind it, the planet is moving in the same direction as you. That means you spend more time in its gravity well catching up to it than if it was stationary. As you pass the planet you have picked up as speed boost from its pull. But as you travel away from it, because you are going faster you spend less time in its influence, so the deceleration is less than the acceleration you picked up on the approach.