Tafsir Ibn Kathir -> Surah Al-Isra' -> The Reason why these Ayat were revealed

This was revealed concerning the disbelievers among the Quraysh, when they wanted to expel the Messenger of Allah from among themselves. So Allah issued a warning to them in this Ayah, telling them that if they expelled him, they would not stay in Makkah for very long after that. And this is what happened after he migrated from them when their persecution became so intense. Only a year and a half after that, Allah brought him and them together on the battlefield of Badr, without any pre-arranged appointment, and He caused him to prevail over them and defeat them, so he killed their leaders and took their families as captives. Hence Allah said:

﴿سُنَّةَ مَن قَدْ أَرْسَلْنَا﴾

(A Sunnah with which We sent) meaning this is what We usually do to those who reject Our Messengers and persecute them by driving the Messenger out from among themselves - the punishment comes to them. If it were not for the fact that the Prophet was the Messenger of Mercy, vengeance would have come upon them such as had never been seen before in this world. So Allah says:

﴿وَمَا كَانَ اللَّهُ لِيُعَذِّبَهُمْ وَأَنتَ فِيهِمْ﴾

(And Allah would not punish them while you are among them.) ﴿8:33﴾

﴿أَقِمِ الصَّلَوةَ لِدُلُوكِ الشَّمْسِ إِلَى غَسَقِ الَّيْلِ وَقُرْءَانَ الْفَجْرِ إِنَّ قُرْءَانَ الْفَجْرِ كَانَ مَشْهُودًا ﴾

﴿وَمِنَ الَّيْلِ فَتَهَجَّدْ بِهِ نَافِلَةً لَّكَ عَسَى أَن يَبْعَثَكَ رَبُّكَ مَقَاماً مَّحْمُودًا ﴾

(78. Perform the Salah from midday till the darkness of the night, and recite the Qur'an in the early dawn. Verily, the recitation of the Qur'an in the early dawn is ever witnessed.) (79. And in some parts of the night (also) offer the Salah with it as an additional prayer for you. It may be that your Lord will raise you to Maqam Mahmud.)