I heard the Prophet ﷺ say, "Souls are like conscripted soldiers. Those that recognize one another come together in harmony, and those that fail to recognize one another part in discord."
سمعت النبي ﷺ يقول: الأرواح جنود مجندة، فما تعارف منها ائتلف، وما تناكر منها اختلف.
Bukhari narrated it in Adab al-Mufrad (900) from Abdullah (that is, Ibn Salih), who said, Layth told me. And also through another chain from Saeed bin Abu Maryam, who said, Yahya bin Ayub told us, both of them from Yahya bin Saeed, from Amrah, from Ayesha, and he mentioned it. He also mentioned it in the Sahih (3336) with a suspended chain from Layth and Yahya bin Ayub.The meaning of the hadith is that man is created from spirit and body, and spirits have inclinations and connections with other spirits. When their natures are close or in agreement, they recognize one another, and distances do not prevent this recognition. But if their natures differ, they repel one another, and no closeness in proximity can benefit them.