The Attitudes of the Hypocrites and the Ways in which Allah tests People
Allah mentions the descriptions of the liars who falsely claim faith with their lips, while faith is not firm in their hearts. When a test or trial comes in this world, they think that this is a punishment from Allah, so they leave Islam.
Allah says;
وَمِنَ النَّاسِ مَن يَقُولُ امَنَّا بِاللَّهِ فَإِذَا أُوذِيَ فِي اللَّهِ جَعَلَ فِتْنَةَ النَّاسِ كَعَذَابِ اللَّهِ
Of mankind are some who say;"We believe in Allah." But if they are made to suffer for Allah, they consider the trial of mankind as Allah's punishment;
Ibn Abbas said,
"Meaning that their trial is leaving Islam if they are made to suffer for Allah."
This was also the view of others among the Salaf.
This Ayah is like the Ayah,
وَمِنَ النَّاسِ مَن يَعْبُدُ اللَّهَ عَلَى حَرْفٍ فَإِنْ أَصَابَهُ خَيْرٌ اطْمَأَنَّ بِهِ وَإِنْ أَصَابَتْهُ فِتْنَةٌ انْقَلَبَ عَلَى وَجْهِهِ
And among mankind is he who worships Allah as it were upon the edge;if good befalls him, he is content therewith; but if a trial befalls him, he turns back on his face... until;
ذلِكَ هُوَ الضَّلَـلُ الْبَعِيدُ
That is a straying far away. (22;11-12)
Then Allah says;
وَلَيِن جَاء نَصْرٌ مِّن رَّبِّكَ لَيَقُولُنَّ إِنَّا كُنَّا مَعَكُمْ
and if victory comes from your Lord, they will say;"Verily, we were with you."
meaning, "if victory comes from your Lord, O Muhammad, and there are spoils of war, these people will say to you, `We were with you,' i.e., we are your brothers in faith."
This is like the Ayat;
الَّذِينَ يَتَرَبَّصُونَ بِكُمْ فَإِن كَانَ لَكُمْ فَتْحٌ مِّنَ اللَّهِ قَالُواْ أَلَمْ نَكُنْ مَّعَكُمْ وَإِن كَانَ لِلْكَـفِرِينَ نَصِيبٌ قَالُواْ أَلَمْ نَسْتَحْوِذْ عَلَيْكُمْ وَنَمْنَعْكُمْ مِّنَ الْمُوْمِنِينَ
Those who wait and watch about you; if you gain a victory from Allah, they say;"Were we not with you" But if the disbelievers gain a success, they say (to them);"Did we not gain mastery over you and did we not protect you from the believers". (4;141)
فَعَسَى اللَّهُ أَن يَأْتِىَ بِالْفَتْحِ أَوْ أَمْرٍ مِّنْ عِندِهِ فَيُصْبِحُواْ عَلَى مَأ أَسَرُّواْ فِى أَنفُسِهِمْ نَـدِمِينَ
Perhaps Allah may bring a victory or a decision according to His will. Then they will become regretful for what they have been keeping as a secret in themselves. (5;52)
And Allah tells us about them here;
وَلَيِن جَاء نَصْرٌ مِّن رَّبِّكَ لَيَقُولُنَّ إِنَّا كُنَّا مَعَكُمْ
(and if victory comes from your Lord, they will say;"Verily, we were with you.")
Then Allah says;
أَوَلَيْسَ اللَّهُ بِأَعْلَمَ بِمَا فِي صُدُورِ الْعَالَمِينَ
Is not Allah Best Aware of what is in the breasts of the creatures!
meaning, `does Allah not know best what is in their hearts and what they store secretly within themselves, even though outwardly they may appear to be in agreement with you!'
وَلَيَعْلَمَنَّ اللَّهُ الَّذِينَ امَنُوا وَلَيَعْلَمَنَّ الْمُنَافِقِينَ