The Prophet Muhammad ﷺ had to leave Makkah, and he had to leave that very night. There were people in Makkah who did not like that he was teaching about Allah, and they wanted to hurt him. Allah had told the Prophet ﷺ it was time to go.
The Prophet ﷺ would not travel alone. He chose his closest, most trusted friend to go with him: Abu Bakr. Together, they would travel to a new city called Madinah, where the Muslims would be safe.
But the journey was dangerous. The people who were against them were watching the roads. So instead of leaving in the daytime, the Prophet ﷺ and Abu Bakr left at night, and they went to a place where no one would look for them: a small cave on a mountain called Mount Thawr.
Inside the cave, it was dark and quiet. The Prophet ﷺ and Abu Bakr could hear footsteps outside. The people who were chasing them had reached the mountain. They were walking close to the cave entrance.
Abu Bakr became worried. He whispered to the Prophet ﷺ, "If they look down at their feet, they will see us!" But the Prophet ﷺ stayed calm. He answered softly, "Do not be sad. Allah is with us."
And then something amazing happened. While the Prophet ﷺ and Abu Bakr were inside the cave, Allah sent two of His smallest creatures to help.
A spider spun a beautiful, delicate web across the entrance of the cave. And a dove built a small nest right at the opening and laid her eggs there.
When the people chasing them looked at the cave, they saw the spider's web stretched across the entrance, untouched. They saw the dove sitting peacefully on her eggs.
One of them said, "Nobody has gone into this cave. The web is whole and the bird is calm. If anyone had entered, the web would be torn and the bird would have flown away."
So they turned and walked away.
The Prophet ﷺ and Abu Bakr stayed safely in the cave. After three days, when the danger had passed, they continued their journey to Madinah. They arrived safely, and Madinah became the new home for the Muslims.
A tiny spider. A small dove. That was all Allah needed to protect the two most important travelers in the world.
When we feel afraid or worried, we can remember what the Prophet ﷺ said to Abu Bakr in the cave: "Do not be sad. Allah is with us." Allah can use the smallest things, like a spider or a dove, to protect us. We are never alone when we trust Allah.
From the Quran: Surah At-Tawbah (9:40) mentions this exact moment in the cave. The full story is recorded in Sahih al-Bukhari and the major seerah works including those of Ibn Ishaq and Ibn Hisham.