Hadith 862
Anas (May Allah be pleased with him) reported that he passed by some children and greeted them. Then he said:
عن أنس رضي الله عنه أنه مر على صبيان، فسلم عليهم، وقال: كان رسول الله صلى الله عليه وسلم يفعله” ((متفق عليه))
"Messenger of Allah (ﷺ) used to do the same." [Al-Bukhari and Muslim].
In plain words
A Companion greeted some children, then explained he did so because the Prophet used to greet children too. It teaches treating even the youngest as worthy of a greeting of peace.
Reference : Riyad as-Salihin 862 In-book reference : Book 5, Hadith 19