The need for the Divine Test is to separate those who call for Truth from those who call for Falsehood. Everyone claims to be a good person, but the truth will only be revealed to everyone in times of hardship as to how much of that claim is actually true.
The Qur’an states that we will test you with fear, hunger, poverty and death of loved ones:
وَلَنَبْلُوَنَّكُم بِشَيْءٍ مِّنَ الْخَوْفِ وَالْجُوعِ وَنَقْصٍ مِّنَ الْأَمْوَالِ وَالْأَنفُسِ وَالثَّمَرَاتِ ۗ وَبَشِّرِ الصَّابِرِينَ
“Surely We will try you with something of fear and hunger, and diminution of goods and lives and fruits; yet give thou good tidings unto the patient.”1
God’s knowledge is not the reason for our rewards and punishments, rather our own actions will be the cause of the rewards and punishments that we will receive in the Hereafter. Let’s look at some examples:
1. Knowing how a particular tailor or builder or carpenter builds or sews is not enough for anything to be made, but rather they must do the work itself in order to be able to present the fruits of their labor.
2. A teacher may know a particular student is not someone who is studying hard, but cannot fail the student before the time of their exams or assignments. Imam Ali AS states that Divine Tests are not for the benefit of Gods knowledge, but rather to set the foundation making it necessary for one to take an action which forms the basis for punishment and reward.
Without a test, people cannot be known.
Patience against a test is how to know someone.
Acceptance and submission when up against hard times is how to know someone.
Contentment and asceticism grows in times of scarcity.
Piety, patience and sacrifice of people becomes known during hardships.