And when a faction of them said, "O people of Yathrib, there is no stability for you [here], so return [home]." And a party of them asked permission of the Prophet, saying, "Indeed, our houses are exposed [i.e., unprotected]," while they were not exposed. They did not intend except to flee.
How the Believers were tested, and the Position of the Hypocrites during the Battle of Al-Khandaq
Allah tells us what happened when the Confederates surrounded Al-Madinah and the Muslims were besieged and found themselves in straitened circumstances, with the Messenger of Allah ﷺ in their midst. They were tried and tested, and were shaken with a mighty shaking. At this time hypocrisy emerged, and those in whose hearts was a disease spoke about what they really felt.
(And when the hypocrites and those in whose hearts is a disease said: "Allah and His Messenger promised us nothing but delusion!") Their hypocrisy became apparent, while the one in whose heart was doubt became weak, and he expressed the ideas that were in his heart because of the weakness of his faith and the difficulty of the situation. And other people said, as Allah tells us:
The second state mentioned here is that of the hypocrites for they had started saying that the promises of Allah and His Rasul ﷺ were a web of deception: إِذْ يَقُولُ الْمُنَافِقُونَ وَالَّذِينَ فِي قُلُوبِهِم مَّرَضٌ مَّا وَعَدَنَا اللَّـهُ وَرَسُولُهُ إِلَّا غُرُورًا (And (remember) when the hypocrites and those having malady in their hearts were saying, "Allah and His messenger did not promise us but deceitfully; -12). This was an externalized demonstration of their inner disbelief. Onward from here, mention has been made of two groups of hypocrites who were practically a part of the Jihad effort along with Muslims, though outwardly only. One of the two groups started running without any permission saying: وَإِذْ قَالَت طَّائِفَةٌ مِّنْهُمْ يَا أَهْلَ يَثْرِبَ لَا مُقَامَ لَكُمْ فَارْجِعُوا (and when a group of them said, "0 people of Yathrib (Madinah), there is no place for you to stay; so go back. - 13" And the other group requested the permission of the Holy Prophet ﷺ to go back on the basis of false excuses. Their conduct has been mentioned as: وَيَسْتَأْذِنُ فَرِيقٌ مِّنْهُمُ النَّبِيَّ يَقُولُونَ إِنَّ بُيُوتَنَا عَوْرَةٌ (And a group of them was seeking permission (to leave) from the prophet, saying, "In fact our homes are vulnerable," while they were not vulnerable - 13). Thus, the Qur'an exposed the hollowness of their excuses as a pack of lies. The truth of the matter was no more than that they intended to run from the battlefront:إِن يُرِيدُونَ إِلَّا فِرَارًا (They wanted nothing but to escape - 13). Taken up in the next several verses is their mischief-making and enmity with Muslims following which their sad end has been pointed out.
After that, the text mentions sincere believers and praises their firmness and fortitude. In the same connection, there comes a strong assertion of the need to obey and follow the Holy Prophet ﷺ almost in the form of a legal rule of conduct: لَّقَدْ كَانَ لَكُمْ فِي رَسُولِ اللَّـهِ أُسْوَةٌ حَسَنَةٌ (There is indeed a good model for you in the Messenger of Allah - 21). From here it stands proved that all sayings and doings of the Holy Prophet ﷺ have to be followed. But, the Shari'ah authorities have explained the rule about the different degrees of following required from a Muslim. The rule is that any act or omission of the Holy Prophet ﷺ proved to have been done as an obligation would have to be obeyed and followed as wajib (obligatory, necessary). And any act or omission on his part that is proved to have been done as a preferable conduct (istihbab) and not as an obligatory one, should be followed by us too as a commendable (mustahab) conduct and not as a necessary obligation This, in other words, means that its contravention will not be declared to be a sin. (For a detailed discussion, see al-Jassas in Ahkam ul-Qur'an)
The last three (25-27) of the cited verses refer to the event relating to Banu Quraizah. In verse 26: وَأَنزَلَ الَّذِينَ ظَاهَرُوهُم مِّنْ أَهْلِ الْكِتَابِ مِن صَيَاصِيهِمْ it was said that Allah Ta’ ala had, by putting the awe of the Holy Prophet ﷺ and his Muslim followers into the hearts of the people of the Book who had helped the Confederate forces, made them come down from their strong fortresses and had thus made Muslims the inheritors of their properties, homes and areas of concentration.
In the last verse (27), good news of future victories has been given. Gone is the time when disbelievers attacked. Now the cycle of Muslim victories will begin and they will come to be on lands their feet have not touched yet. And this prophecy unfolded itself during the tenure of the noble Sahabah and everyone witnessed the spectacle of great empires ruled by Cyrus and Caesar come under them. And Allah does what He wills.
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 11–16
At the battle of Ahzab (in the fifth year of Hijrah) there was a combined attack by Arab tribes and Jews on Madinah. The number of attackers in this battle was about thirteen thousand and the Muslims were not capable of fighting this huge army. But, Almighty God, by His special devices, caused Islam’s enemies to become so terror-stricken that they themselves abandoned the siege of Madinah and retreated. Such difficulties befall the Islamic mission firstly in order to separate the sincere from the insincere and secondly to show to the enemy forces that God Himself is a supporter of His religion. He will not allow it to be vanquished.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.