When the Muslims were facing difficulty under the hands of the Quraysh, and when they thought all hope was lost, few from Yathrib (the now Madinah) embraced Islam and they happily agreed to help their fellow brothers and sisters suffering in Makkah.
This did not go well down the throat of the Quraysh , so they plotted to kill the Prophet صلى الله عليه وسلم
After the second pledge of Aqaba (the oath of allegiance), the Prophet صلى الله عليه وسلم like a true leader appointed twelve men who will be responsible for the affairs of the community. After these twelve were elected, the Prophet صلى الله عليه وسلم said to them : “You are like the apostles of Isa (Jesus) عليه السلام . You are responsible for the community in Yathrib (now Madinah) while I am the caretaker of the entire body of Muslims.”
The next morning the Quraysh having heard a rumor about the pledge at Aqaba, went to the Yathrib camp to protest against what happened, the polytheists of Yathrib who knew nothing about the event, insisted nothing had taken place, while the Muslims kept silent. However, the Quraysh found out that the rumor was indeed true, they sent their horsemen to apprehend any who took part in the pledge. They captured two companions among the twelve who were chosen by the prophet, one of them escaped, while the other was bound and taken to Makkah. The Muslims in Yathrib when they knew what happened, they planned to raid Makkah in order to free their brother. But before they could carry out their plans, two of the Makkans freed him.
After the second pledge of Aqaba, the Muslims increased in number and grew strong. They now had a new refugee in Yathrib and the people there were ready to protect them and help them. Soon the Prophet صلى الله عليه وسلم received revelation about migration to Yathrib, and soon after several of the companions migrated along with their families. The first migrant was Abu Salamah AlMakhzoomi رضي الله عنه the husband of Umm Salamah رضي الله عنها, when he attempted to maigrate with his wife and children, his clan did not allow him to do so, so his wife Umm Salamah and his children migrated a year later. There were many others who migrated in the darkness of the night, for some slipping out of Makkah was difficult, but when Umar bin AlKhattab رضي الله عنه migrated in the watchful eyes of the Quraysh, no one dared to stop him, he also took twenty others with him. After nearly all the Muslims in Makkah migrating to the Yathrib, the Muslims in Abbysina also migrated.
However, few companions along with the Prophet صلى الله عليه وسلم ,Ali رضي الله عنه and the family of Abu Bakr رضي الله عنه stayed in Makkah awaiting Allah’s permission to leave.
When the Quraysh found out that the Muslims had found a safe place in the Arabian Peninsula, they were enraged. They also feared that the Muslims would become very strong and take control over the northern Arabia and Syria and disrupt their trade.
To discuss their concerns and to take control over the Muslims, the leaders of all the clans of Quraysh held a meeting at Dar AlNadwa, one of them was the Satan who came disguised.
They came up with the plan that, they would select a strong youth from each tribe of Quraysh and station them surrounding the Prophet’s صلى الله عليه وسلم house. And when the Prophet صلى الله عليه وسلم comes out of his house at day break, they would attack on him.
But Allah, the knower of the unseen, the All Hearer and the One who knows what is hidden in the hearts of the people, knew about the plans of the Quraysh and He would protect His Prophet صلى الله عليه وسلم. So Jibreel came down with glad tidings that the Prophet صلى الله عليه وسلم can now migrate to Madinah and join his companions. And the angel Jibreel also informed of the evil plans of the Quraysh and told him not to sleep on his bed that night. So when everyone went to sleep, Quraysh surrounded the Prophet’s house, unaware that Allah was plotting against them too.
And [remember, O Muhammad], when those who disbelieved plotted against you to restrain you or kill you or evict you [from Makkah]. But they plan, and Allah plans. And Allah is the best of planners. (Surah AlAnfal: 30)
The Prophet صلى الله عليه وسلمmade Ali رضي الله عنه to sleep in his place and quietly went out and took a handful of dust in his hands and sprinkled above the youths head while reciting this Ayah.
And We have put before them a barrier and behind them a barrier and covered them, so they do not see. (Surah Ya-Sin: 9)
The youths outside did not see the Prophet صلى الله عليه وسلم leaving the house, and when it was day break and when Ali came out instead of the Prophet صلى الله عليه وسلم they realized they were tricked and coaxed Ali into telling them where the Prophet was, but Ali رضي الله عنه did not budge. Then they went to the house of Abu Bakr and found out that his was missing too, so they asked his daughter Asma’a and when she also declined to tell them where the Prophet was, the furious Abu Jahl, slapped her so hard that her earrings fell off.
The Quraysh grew even furious, they would do anything to find the Prophet صلى الله عليه وسلم alive or dead.