(49) باب الأَرْوَاحِ جُنُودٌ مُجَنَّدَةٌ
Abu Huraira narrated directly from Allah's Messenger (ﷺ) that he said:
People are like mines of gold and silver; those who were excellent in Jahiliya (during the days of ignorance) are excellent In Islam, when they have, an understanding, and the souls are troops collected together and those who had a mutual familiarity amongst themselves in the store of prenatal existence would have affinity amongst them, (in this world also) and those who opposed one of them, would be at variance with one another.
Reference: Sahih Muslim 2638 b
In-book reference: Book 45, Hadith 205
USC-MSA web (English) reference(deprecated numbering scheme): Book 32, Hadith 6377