"[That He might test you] means: to put you to the test through commands and prohibitions. [As to which of you is best in deed] means: regarding that which He has tested you with of commands and prohibitions.
Muhammad said: The meaning is: He tests you with the testing for which He will recompense you; yet He already knew before that which of them would be best in deed.
Surah Hud from verse (8) to verse (12)."
﴿ليبولكم﴾ لِيَخْتَبِرَكُمْ بِالأَمْرِ وَالنَّهْيِ ﴿أَيُّكُمْ أَحْسَنُ عملا﴾ فِيمَا ابْتَلاكُمْ بِهِ مِنَ الأَمْرِ وَالنَّهْيِ.
قَالَ مُحَمَّدٌ: الْمَعْنَى: يَخْتَبِرُكُمُ الاخْتِبَارَ الَّذِي يُجَازِيكُمْ عَلَيْهِ؛ وَهُوَ قَدْ عَلِمَ قَبْلَ ذَلِكَ أَيُّهُمْ أحسن عملا.
سُورَة هود من الْآيَة (٨) إِلَى الْآيَة (١٢).