Be First To Greet Others with Peace
We learn in the Mishna that a person should be prompt to greet others: “Rebbe Matia ben Charash says, be first to greet [literally, say Shalom to] all people” (Avot 4:16). The reason for this is elaborated in the gemara in Berakhot (17a): “A pearl [valuable adage] in the mouth of Abaye: A person should always be sly in reverence, for ‘A soft reply turns away wrath’ (Mishlei 15:1), and increase peace among his brothers and his relatives and with every man, and even a stranger in the marketplace, so that he may be beloved on high and esteemed below, and should be accepted among human beings. It was said of Rabban Yochanan ben Zakai that no one ever preceded him in a greeting [of Shalom], even a stranger in the marketplace.”
We see that the reason for trying to be the first to greet others is simply in order to be friendly to others and accepted among them. (A passage with a parallel message is found in Kiddushin 33a.)