Because entering Paradise requires effort, and this purification and trial that afflicts a person is the way to enter Paradise, that is why Allah (swt) said: {and made evident those who are steadfast} because patience is the basic tool for facing trials in life, so we said earlier that Allah (swt )said:
وَاسْتَعِينُواْ بِالصَّبْرِ وَالصَّلاَةِ
{And seek help through patience and prayer} (Al-Baqara: 45)
He put patience before prayer; because patience is one of the effects of prayer and the connection with Allah (swt). You may be able to pray a thousand rak’ahs, but you cannot be patient for a minute on a hard matter, so struggling oneself with patience is the way to face the tests of life, for that Allah (swt) says:
وَبَشِّرِ الصَّابِرِينَ
{give good tidings to the patient}. (Al-Baqara: 155)
وَلَمَّا يَعْلَمِ اللّهُ الَّذِينَ جَاهَدُواْ مِنكُمْ {while Allah has not yet made evident those of you who fight in His cause}: Of course Allah (swt) knows, but this test is for you not for Allah (swt) in order to know whether you are patient or not, He knows, but He (swt) holds a person accountable for his work not for His (swt) knowledge.