The tribes of Hawazin and Thaqif did not want to submit to Islam so they decided to fight against the Muslims;
The Prophet marched to meet them with 12,000 men;
The enemy were already waiting for the Muslim army, hiding and waiting to hurl stones and arrows at them;
When this happened, the enemy attack became fierce and the Muslims started to retreat;
The Prophet (pbuh) called out: ‘Come on, people! I am the Messenger of Allah. I am Muhammad, the son of Abdullah.’
Because the enemy’s leader Malik bin ‘Awf had told everyone to take their families and belongings with them, the Muslims captured huge spoils of war.
This battle is mentioned in Sura Tawba, v25–26.
Indeed Allah has given you ˹believers˺ victory on many battlefields, even at the Battle of Ḥunain when you took pride in your great numbers, but they proved of no advantage to you. The earth, despite its vastness, seemed to close in on you, then you turned back in retreat. (9:25)