From the Messenger of Allah ﷺ, and Kathir said on one occasion that it was a hadith he traced back to the Prophet, he said, "People are like mines, like mines of silver and gold. The best of them in the days of ignorance are the best of them in Islam, provided they gain understanding of the religion. Souls are like conscripted soldiers. Those that recognize one another draw close, and those that fail to recognize one another part ways."
حدثنا كثير حدثنا جعفر حدثنا يزيد بن الأصم
عن رسول الله ﷺ و قال كثير مرة حديث رفعه قال الناس معادن كمعادن الفضة والذهب خيارهم في الجاهلية خيارهم في الإسلام إذا فقهوا والأرواح جنود مجندة ما تعارف منها ائتلف وما تناكر منها اختلف
Its isnad is sahih, and much of it has been dropped in the printed edition, which is an error, because Ahmad did not hear from Jaafar, as noted previously in the first part at 10245, and the second part at 10786.