The Madinan Period, Part 1: The Hijrah to Madīnah
Section 11 of 29 · The Life of the Prophet Muhammad: The Madinan Period
Three Days in the Cave
Then they reached the cave, and Abū Bakr al-Ṣiddīq, may Allah be pleased with him, went in to check it, to make sure there were no snakes, no scorpions, no ambush, and only then told the Messenger of Allah (peace be upon him) to come in. When they were in the cave, the disbelievers of Quraysh succeeded in following their tracks until they reached the mouth of the cave. Abū Bakr al-Ṣiddīq, may Allah be pleased with him, told the Messenger of Allah (peace be upon him), "O Messenger of Allah, if one of them were to look right under their feet, they would see us" — they were right there at the mouth of the cave. The Messenger of Allah (peace be upon him), with full confidence, said, "O Abū Bakr, what do you think of two, when Allah is their third?" — mā ẓannuka bi-ithnayni Allāhu thālithuhumā — Abū Bakr, how would you regard the safety of two people who had Allah as their third companion?
What stopped them from entering the cave was the web of a spider.
مَثَلُ ٱلَّذِينَ ٱتَّخَذُوا۟ مِن دُونِ ٱللَّهِ أَوْلِيَآءَ كَمَثَلِ ٱلْعَنكَبُوتِ ٱتَّخَذَتْ بَيْتًا ۖ وَإِنَّ أَوْهَنَ ٱلْبُيُوتِ لَبَيْتُ ٱلْعَنكَبُوتِ ۖ لَوْ كَانُوا۟ يَعْلَمُونَ
“The example of those who have adopted patrons other than Allah is like the spider that has made a house, while indeed the weakest of houses is the house of the spider. If only they know.” (29:41)
The most feeble of houses is the house of a spider. With one finger, the whole web could be torn down. So this feeble, weak web was the soldier of Allah (swt) that stopped the disbelievers from entering into the cave, and this shows that Allah (swt) can choose the weakest of His creation to be His soldier. The account of the web of the spider is an agreeable narration; it is ḥasan.
Allah (swt) revealed an ayah about this later, a few years after the hijrah; this ayah is in Sūrat al-Tawbah, and Allah (swt) is speaking to the Ṣaḥābah, telling them that if they do not aid him, Allah has already aided him. On the day Abū Bakr was the only companion of the Messenger of Allah (peace be upon him), and the disbelievers were surrounding the cave, none of the rest of the Ṣaḥābah were around, and Allah did not need them to support His Prophet. So Allah is telling the Ṣaḥābah, if they do not aid him now, Allah has already aided him.
إِلَّا تَنصُرُوهُ فَقَدْ نَصَرَهُ ٱللَّهُ إِذْ أَخْرَجَهُ ٱلَّذِينَ كَفَرُوا۟ ثَانِىَ ٱثْنَيْنِ إِذْ هُمَا فِى ٱلْغَارِ إِذْ يَقُولُ لِصَـٰحِبِهِۦ لَا تَحْزَنْ إِنَّ ٱللَّهَ مَعَنَا ۖ فَأَنزَلَ ٱللَّهُ سَكِينَتَهُۥ عَلَيْهِ وَأَيَّدَهُۥ بِجُنُودٍ لَّمْ تَرَوْهَا وَجَعَلَ كَلِمَةَ ٱلَّذِينَ كَفَرُوا۟ ٱلسُّفْلَىٰ ۗ وَكَلِمَةُ ٱللَّهِ هِىَ ٱلْعُلْيَا ۗ وَٱللَّهُ عَزِيزٌ حَكِيمٌ
“If you do not help him, (it makes no difference to the Prophet, because) Allah has already helped him when the disbelievers expelled him, and he was the second of the two, when they were in the cave, and he was saying to his companion, “Do not grieve. Allah is surely with us.”So, Allah caused His tranquility to descend on him,and supported him with troops that you did not see, and rendered the word of the disbelievers humiliated. And the word of Allah is the uppermost. Allah is Mighty, Wise.” (9:40)
When those who disbelieved had driven him out as one of two, when they were in the cave, and he said to his companion — notice here that Allah is calling Abū Bakr the companion of the Messenger of Allah (peace be upon him), an honor to Abū Bakr al-Ṣiddīq — do not grieve, indeed Allah is with us. And Allah sent down His tranquility upon him and supported him with soldiers he did not see, and made the word of those who disbelieved the lowest, while the word of Allah, that is the highest, and Allah is exalted in might and wise. So the soldiers of Allah referred to in this ayah are the angels — these are the unseen soldiers — but then there is also the spider, which was a soldier that could be seen.