Abu Hurairah reported the Messenger of Allah (May peace be upon him) as saying: one who is riding should salute one who is walking. He then mentioned the rest of the tradition.
By showing courtesy and respect towards those who are walking while we are riding, we can make their day just a little bit brighter by acknowledging them with a simple greeting or salutation. This small act of kindness will not only make them feel appreciated but will also help us cultivate good relationships with others around us which will ultimately benefit our society as well.