وَأَلَّفَ بَيْنَ قُلُوبِهِمْ لَوْ أَنفَقْتَ مَا فِي الَارْضِ جَمِيعاً مَّا أَلَّفَتْ بَيْنَ قُلُوبِهِمْ وَلَـكِنَّ اللّهَ أَلَّفَ بَيْنَهُمْ إِنَّهُ عَزِيزٌ حَكِيمٌ
He it is Who has supported you with His help and with the believers. And He has united their hearts.
The Ayah says, `it is Allah who gathered the believers' hearts, believing, obeying, aiding and supporting you -- O Muhammad,'
لَوْ أَنفَقْتَ مَا فِي الَارْضِ جَمِيعاً مَّا أَلَّفَتْ بَيْنَ قُلُوبِهِمْ
If you had spent all that is in the earth, you could not have united their hearts.
because of the enmity and hatred that existed between them.
Before Islam, there were many wars between the Ansar tribes of Aws and Khazraj, and there were many causes to stir unrest between them. However, Allah ended all that evil with the light of faith,
وَاذْكُرُواْ نِعْمَةَ اللَّهِ عَلَيْكُمْ إِذْ كُنتُم أَعْدَاءً فَأَلَّفَ بَيْنَ قُلُوبِكُمْ فَأَصْبَحْتُم بِنِعْمَتِهِ إِخْوَاناً وَكُنتُمْ عَلَى شَفَا حُفْرَةٍ مِّنَ النَّارِ فَأَنقَذَكُمْ مِّنْهَا كَذلِكَ يُبَيِّنُ اللَّهُ لَكُمْ ءَايَـتِهِ لَعَلَّكُمْ تَهْتَدُونَ
And remember Allah's favor on you, for you were enemies one to another, but He united your hearts, so that, by His grace, you became brethren, and you were on the brink of a pit of Fire, and He saved you from it. Thus Allah makes His Ayat clear to you, that you may be guided. (3;103)
In the Two Sahihs, it is recorded that when the Messenger of Allah gave a speech to the Ansar about the division of war booty collected in the battle of Hunayn, he said to them,
يَا مَعْشَرَ الاْاَنْصَارِ أَلَمْ أَجِدْكُمْ ضُلَّلاًا فَهَدَاكُمُ اللهُ بِي وَعَالَةً فَأَغْنَاكُمُ اللهُ بِي وَكُنْتُمْ مُتَفَرِّقِينَ فَأَلَّفَكُمُ اللهُ بِي
O Ansar! Did I not find you misguided and Allah guided you by me, poor and Allah enriched you by me, and divided and Allah united you by me.
Every question the Prophet asked them, they said, "Truly, the favor is from Allah and His Messenger."
Allah said,
وَلَـكِنَّ اللّهَ أَلَّفَ بَيْنَهُمْ إِنَّهُ عَزِيزٌ حَكِيمٌ
But Allah has united them. Certainly He is All-Mighty, All-Wise.
He is the Most Formidable, and the hopes of those who have trust in Him, never end unanswered; Allah is All-Wise in all of His decisions and actions