"And We dispersed them in the earth" - meaning: We separated them. Mujahid said: meaning, the Jews. "Among them are the righteous" - meaning: the believers, "and among them are those other than that" - meaning: disbelievers. "And We tested them" - meaning: We examined them, "with good and bad" - meaning: with hardship and ease, "that perhaps they might return" - to faith.
﴿وقطعناهم فِي الأَرْض﴾ أَيْ: فَرَّقْنَاهُمْ، قَالَ مُجَاهِدٌ: يَعْنِي: الْيَهُود ﴿مِنْهُم الصالحون﴾ يَعْنِي: الْمُؤْمِنِينَ ﴿وَمِنْهُمْ دُونَ ذَلِكَ﴾ يَعْنِي: كفَّارًا ﴿وبلوناهم﴾ اختبرناهم ﴿بِالْحَسَنَاتِ والسيئات﴾ يَعْنِي: بِالشِّدَّةِ وَالرَّخَاءِ ﴿لَعَلَّهُمْ يَرْجِعُونَ﴾ إِلَى الْإِيمَان