Jabir bin 'Abdullah (RA) reported that it was concerning them (the Ansar) that this verse was revealed, that when the two groups amongst you were about to lose heart and Allah was the Guardian of them both. This concerned Banu Salama and Banu Haritha and we did not like that Allah, the Exalted and Glorious, should not have revealed this verse for the fact that Allah (gave an assurance) of being the Guardian of both.
Explanation & Benefits
Shaykh Maulana Abdul Aziz Alvi
Hadith Commentary: Benefits and Issues: This verse was revealed concerning the two Ansar tribes: Banu Salamah, which is the Khazraj tribe of Jabir radi Allahu anhu, and Banu Harithah, which is from the Aws clan. This occurred when they saw that Abdullah bin Ubayy, along with his group, had abandoned the Muslims, resulting in a decrease in the number of Muslims. Consequently, a sense of discouragement began to arise among them, but Allah made their feet firm. This incident pertains to the Battle of Uhud.
Source: Tuhfat al-Muslim: Commentary on Sahih Muslim, Page: 6413