We will cast terror into the hearts of those who disbelieve for what they have associated with Allāh of which He had not sent down [any] authority. And their refuge will be the Fire, and wretched is the residence of the wrongdoers.
The Prohibition of Obeying the Disbelievers; the Cause of Defeat at Uhud
Allah warns His believing servants against obeying the disbelievers and hypocrites, because such obedience leads to utter destruction in this life and the Hereafter. This is why Allah said,
The previous verses referred to Allah Almighty as the best of helpers'; recounted here are some incidents of Allah's help.
The word, سلطان sultan, rendered here as 'authority' includes all revealed or rational bases of their position. The promise of casting awe and fear into the hearts of the disbelievers in this verse was made in the back-ground of the battle of Uhud when the disbelievers of Arabia marched back to Makkah without any obvious reason and inspite of defeat overtaking Muslims (Baydawi). However, after having covered a certain distance on their way to Makkah, they awoke to their folly. When they thought of marching back to Madinah, Allah Almighty filled their hearts with such awe and fear that they could not muster the courage to do so. The most they could do was to hire a Madinah-bound villager to go there and tell Muslims that they were coming back. But, this whole deal came into the knowledge of the Holy Prophet ﷺ in Madinah through revelation. He marched to Hamra' al-Asad to apprehend them but they had already run away from there.
This was the background in which the present verse was revealed.
The verses that follow recount, as pointed out earlier, Allah's help and support for Muslims in the battle of Uhud.
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 151–152
The temporary defeat of the Muslims at the battle of Uhud gave an opportunity to the opponents of Islam to prove their stand that the credo of the Prophet and his companions was not a divine matter. It was just the boyish enthusiasm of certain people and now they were suffering for it. Their enemies would point out that had it pertained to God, they would never have been defeated at the hands of their opponents. However, such happenings, even if the results of the Muslims’ own errors, are, at all events, ‘test papers’ from God. A happening like that of Uhud must take place in this world in order to find out who are the ones who truly trust in God and who are the ones who are to fall by the wayside. Such happenings serve as a two-sided trial for the believer. He passes the test only if he perseveres at all times, is not influenced by the adverse remarks of others and is not discouraged by temporary setbacks.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.