To get a spacecraft to Mercury, we therefore have to match its orbit. When BepiColombo was launched, its orbital energy was the same as our home planet’s. Therefore, BepiColombo needs to either use a vast amount of propellant to ‘put on the brakes’, or it can shed excess orbital energy by flying close to neighbouring planets.
The same works in reverse to voyage to the outer Solar System. To get into a larger orbit, further from the Sun, a spacecraft such as ESA’s upcoming Juice mission to Jupiter will steal orbital energy from Earth, Venus and Mars.