The Quran tells the believers not to be like the pagans of Quraysh who left their homes to fight against the Prophet (saws), in al-Madinah. Despite that Abu Sufyan returned safely with the caravan, they insisted on going forth out of arrogance so that the Arab tribes might know about their defeat, so they would continue to be a source of fear for the people, as Abu Jahl stated. Their another aim was to defeat the Prophet (saws), thus erecting barriers between the remaining Arab tribes and the belief in the Messenger of Allah (saws).
(…وَاللَّهُ بِمَا يَعْمَلُونَ مُحِيطٌ) (And Allah is encompassing of what they do.): Allah (swt), is aware of their deeds and their innermost intentions. The Pagan Arabs were engaged in a misguided demonstration driven by pride, seeking reputation, and turning away from the path of Allah (swt). The result was their defeat and the glorious victory for the Muslims. Islam spread, and Arab tribes entered into the religion of Allah (swt) in large numbers, contrary to their initial assumptions.