Imam Ibn Balban said in his work Mukhtasar al-Ifadat:
“Point of benefit: If a person walks with someone who is higher than them in terms of rank and virtue, then he should walk on the other person’s hand side, similar to how he would be to the Imam in the prayer. If however the other person (he is walking with) is lesser than him in rank then he should walk on the other person’s left hand side, meaning that this person is to his right.”