(179) “Allah would not leave the believers in the state you are in until He distinguishes the wicked from the good. Nor would Allah disclose the unseen to you; rather, Allah chooses from among His messengers whom He wills. So believe in Allah and His messengers. If you believe and remain mindful of Him, you will have a tremendous reward.”
That is, it was not consistent with Allah’s wisdom to leave the believers in your present state of intermingling and lack of distinction(1), without distinguishing the wicked from the good, the believer from the hypocrite, and the truthful from the liar.
Nor was it consistent with His wisdom to disclose to His servants the unseen that He knows concerning them. His consummate wisdom therefore required that He put His servants to the test and try them through the various ordeals and trials by which the wicked are distinguished from the good. Thus [Allah] sent His messengers and commanded people to obey them, submit to them, and believe in them; and He promised them a tremendous reward for faith and mindfulness of Him.
People were consequently divided into two groups according to whether they followed the messengers: the obedient and the disobedient, the believers and the hypocrites, and the Muslims and the disbelievers. This was so that reward and punishment might follow accordingly, and so that His justice, grace, and wisdom might be made manifest to His creation.