Overall meaning:
The idolaters kept the Prophet ﷺ and his Companions so occupied with manning the defenses of Madinah and protecting their very lives that the ʿAsr prayer slipped away and the sun set. Only after sunset were they able to perform it. The Prophet ﷺ therefore invoked against the aggressors, asking that their bellies and their graves be filled with fire, because they had harmed him and his Companions and had prevented them from offering the ʿAsr prayer—the most excellent of the prayers.
Scholarly disagreement:
The scholars have differed over what is meant by “the middle prayer” in the verse, “Guard your prayers, and the middle prayer” (Q 2:238). Al-Shawkani listed 17 opinions along with their proofs, but there is no need to rehearse them here for fear of lengthening the discussion with little benefit. The explicit, sound hadith evidence—followed by the great majority of earlier and later scholars—shows that the intended prayer is the ʿAsr prayer. Every other view is weak in proof and carries no persuasive weight.
Lessons drawn from the hadith:
1- “The middle prayer” is the ʿAsr prayer. In the two Ṣaḥīḥs it is related from ʿAlī: “We used to think it was Fajr until I heard the Messenger of Allah ﷺ on the Day of the Trench say, ‘They kept us from the middle prayer, the ʿAsr prayer.’” Ibn al-Athīr said: It is called the middle prayer because it is the best and most richly rewarded of the prayers, and for that reason Allah singled it out for special care.
2- It is permissible to delay a prayer beyond its time when one is genuinely unable to perform it. This incident most likely occurred before the legislation of the fear prayer, after which they were commanded to pray whether on foot or mounted. Qāḍī ʿIyāḍ said that the Prophet intentionally delayed it, and the fear prayer later abrogated that ruling. Ibn Ḥajar held this to be the stronger view, especially since Aḥmad and al-Nasāʾī report in the ḥadith of Abū Saʿīd that it took place before Allah revealed concerning the fear prayer, “whether on foot or riding.”
3- Whoever forgets—or is distracted from—a prayer during its appointed time must offer it as soon as he remembers.