Remember He covered you with a sort of drowsiness, to give you calm as from Himself, and he caused rain to descend on you from heaven, to clean you therewith, to remove from you the stain of Satan, to strengthen your hearts, and to plant your feet firmly therewith.
In the Battle of Uhud the Muslims passed through a similar experience 3:154 . On both occasions, when prevalent conditions should have produced intense fear and panic among them, God filled their hearts with such peace and tranquillity that they were overpowered with drowsiness.
Maududi, Abul Ala (2010). Tafhim ul Quran. https://www.englishtafsir.com/Quran/27/index.html