It’s to save the user time from having to re-input values.
I’ve heard it called a swap button, but that’s informal.
This is a common pattern in applications where a trip is being planned (or en route). It allows users to quickly reverse the start and end destinations.
The principle behind it is more important to know: don’t make users do more work than they need to.