It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The younger should greet the elder, the one who is walking should greet the one who is sitting, and the smaller group should greet the larger group."
Benefits and Issues: ➊ From this narration, another etiquette of greeting (salam) is learned: that the younger ones should initiate the greeting (salam) to the elders. This is because honoring and respecting elders is obligatory. Along with age, this also indicates consideration for rank, position, and scholarly status. ➋ The scholars have written that while passing through a crowd or marketplace, it is not necessary to greet every individual, because doing so is not possible. (Fadlullah al-Samad)
Source: Fadlullah al-Ahad: Urdu Commentary on al-Adab al-Mufrad, Page: 1001