It is called "button routing." When the buttons are nicely lined up, "automatic" (the default) usually works well. But sometimes not.
In the menu viewer, click on the icon for "routing." This will show you what "number" each button is, and what number button each remote arrow click will go to.
You can turn automatic routing off, and drag these numbers to set the remote as you wish.