As for his statement, “There is no merit in the cave,” the answer is that the merit associated with the cave is evident from the explicit wording of the Quran, for Allah Most High says:
“When he said to his companion, ‘Do not grieve; indeed, Allah is with us.’” [Surah al-Tawbah: 40]
The Messenger [may Allah bless him and grant him peace] (1) thus stated that Allah was with him and his companion, just as He said to Moses and Aaron:
“Indeed, I am with you both; I hear and I see.” [Surah Tā Hā: 46]
The two compilers related (2) in their Sahīh collections, through Anas, that Abū Bakr al-Siddīq—may Allah be pleased with him—said: “I looked at the feet of the polytheists above our heads while we were in the cave, and I said, ‘O Messenger of Allah, if any one of them were to look down at his feet, he would see us.’ He replied, ‘O Abū Bakr, what do you think of two whose third is Allah?’” (3)
Not only have the scholars of hadith unanimously agreed that this hadith is authentic, accepting it and affirming its truth—with no two of them differing on this—but its meaning is also attested by the Quran, which says:
“When he said to his companion, ‘Do not grieve; indeed, Allah is with us.’” [Surah al-Tawbah: 40]
In Allah’s Book, His being with others is of two kinds: general and particular. The general kind is exemplified by His words, Most High: