Treaty of Hudaybiyyah
Quran scholars claim that the textual context of this particular passage is defensive war after the Treaty of Hudaybiyyah was broken by the Qurayshi-affiliated Banu Bakr tribe when they attacked the Muslim-allied tribe of Banu Khaza'a. In response, the Prophet sent a letter requesting the Quraysh to either terminate their alliance with Banu Bakr or pay a ransom. The Quraysh rejected both of Mohammad's offers, thus, breaking the treaty. It is also agreed upon that the verse refers to only the ones who broke the treaty.