The Muhajirin and Al-Ansar are the Supporters of One Another
Allah says;
إِنَّ الَّذِينَ امَنُواْ وَهَاجَرُواْ وَجَاهَدُواْ بِأَمْوَالِهِمْ وَأَنفُسِهِمْ فِي سَبِيلِ اللّهِ وَالَّذِينَ اوَواْ وَّنَصَرُواْ أُوْلَـيِكَ بَعْضُهُمْ أَوْلِيَاء بَعْضٍ
8;72 Verily, those who believed, and emigrated and strove hard and fought with their property and their lives in the cause of Allah as well as those who gave (them) asylum and help, -- these are (all) allies to one another.
Here Allah mentions the types of believers, dividing them into the Muhajirin, who left their homes and estates, emigrating to give support to Allah and His Messenger to establish His religion. They gave up their wealth and themselves in this cause. There are also the Ansar, the Muslims of Al-Madinah, who gave asylum to their Muhajirin brethren in their own homes and comforted them with their wealth. They also gave aid to Allah and His Messenger by fighting alongside the Muhajirun. Certainly they are,
بَعْضُهُمْ أَوْلِيَاء بَعْضٍ
(allies to one another), for each one of them has more right to the other than anyone else.
This is why Allah's Messenger forged ties of brotherhood between the Muhajirin and Ansar, as Al-Bukhari recorded from Ibn Abbas.
They used to inherit from each other, having more right to inheritance than the deceased man's relatives, until Allah abrogated that practice with the fixed share for near relatives.
Imam Ahmad recorded that Jarir bin Abdullah Al-Bajali said that the Messenger of Allah said,
الْمُهَاجِرُون وَالاَْنْصَارُ أَوْلِيَاءُ بَعْضُهُمْ لِبَعْضٍ وَالطُّلَقَاءُ مِنْ قُرَيْشٍ وَالْعُتَقَاءُ مِنْ ثَقِيفٍ بَعْضُهُمْ أَوْلِيَاءُ بَعْضٍ إِلَى يَوْمِ الْقِيَامَة
The Muhajirun and Al-Ansar are the supporters of each other, while the Tulaqa of Quraysh (whom the Prophet set free after conquering Makkah) and Utaqa from Thaqif (whom the Prophet set free from captivity after the battle of Hunayn) are supporters of each other until the Day of Resurrection.
Only Ahmad collected this Hadith.
Allah praised the Muhajirin and the Ansar in several Ayat of His Book and His Messenger (also praised them too).
Allah said,
وَالسَّـبِقُونَ الاٌّوَّلُونَ مِنَ الْمُهَـجِرِينَ وَالَانْصَـرِ وَالَّذِينَ اتَّبَعُوهُم بِإِحْسَانٍ رَّضِىَ اللَّهُ عَنْهُمْ وَرَضُواْ عَنْهُ وَأَعَدَّ لَهُمْ جَنَّـتٍ تَجْرِي تَحْتَهَا الَانْهَـرُ
And the foremost to embrace Islam of the Muhajirun and the Ansar and also those who followed them exactly. Allah is well-pleased with them as they are well-pleased with Him. He has prepared for them gardens under which rivers flow (Paradise). (9;100)
لَقَدْ تَابَ الله عَلَى النَّبِىِّ وَالْمُهَـجِرِينَ وَالاٌّنصَـرِ الَّذِينَ اتَّبَعُوهُ فِى سَاعَةِ الْعُسْرَةِ
Allah has forgiven the Prophet, the Muhajirin and the Ansar who followed him in the time of distress. (9;117)
and,
لِلْفُقَرَاءِ الْمُهَـجِرِينَ الَّذِينَ أُخْرِجُواْ مِن دِيَـرِهِمْ وَأَمْوَلِهِمْ يَبْتَغُونَ فَضْلً مِّنَ اللَّهِ وَرِضْوَناً وَيَنصُرُونَ اللَّهَ وَرَسُولَهُ أُوْلَـيِكَ هُمُ الصَّـدِقُونَ
وَالَّذِينَ تَبَوَّءُوا الدَّارَ وَالاِيمَـنَ مِن قَبْلِهِمْ يُحِبُّونَ مَنْ هَاجَرَ إِلَيْهِمْ وَلَا يَجِدُونَ فِى صُدُورِهِمْ حَاجَةً مِّمَّأ أُوتُواْ وَيُوْثِرُونَ عَلَى أَنفُسِهِمْ وَلَوْ كَانَ بِهِمْ خَصَاصَةٌ
(And there is also a share in this booty) for the poor Muhajirin, who were expelled from their homes and their property, seeking bounties from Allah and (His) good pleasure, and helping Allah and His Messenger. Such are indeed the truthful.
And those who, before them, had homes (in Al-Madinah) and adopted the faith, love those who emigrate to them, and have no jealousy in their breasts for that which they have been given, and give them (emigrants) preference over themselves even though they were in need of that. (59;8-9)
The best comment on Allah's statement,
وَلَا يَجِدُونَ فِى صُدُورِهِمْ حَاجَةً مِّمَّأ أُوتُواْ
(...and have no jealousy in their breasts for that which they have been given) is that it means,
they do not envy the Muhajirin for the rewards that Allah gave them for their emigration.
These Ayat indicate that the Muhajirin are better in grade than the Ansar, and there is a consensus on this ruling among the scholars.
The Believers Who did not emigrate did not yet receive the Benefits of Wilayah
Allah said,
وَالَّذِينَ امَنُواْ وَلَمْ يُهَاجِرُواْ مَا لَكُم مِّن وَلَايَتِهِم مِّن شَيْءٍ حَتَّى يُهَاجِرُواْ
And as to those who believed but did not emigrate, you owe no duty of protection to them until they emigrate,
This is the third category of believers, those who believed, but did not perform Hijrah and instead remained in their areas. They do not have any share in the war booty or in the fifth (designated for Allah and His Messenger, the relatives of the Prophet, the orphans, the poor and the wayfarer), unless they attend battle.
Imam Ahmad recorded that Buraydah bin Al-Hasib Al-Aslami said,
"When the Messenger of Allah would send a commander with an expedition force or an army, he would advise him to have Taqwa of Allah and be kind to the Muslims under his command.
He used to say,
اغْزُوا بِاسْمِ اللهِ
فِي سَبِيلِ اللهِ
قَاتِلُوا مَنْ كَفَرَ بِاللهِ
Fight in the Name of Allah,
in the cause of Allah.
Fight those who disbelieve in Allah.
إِذَا لَقِيتَ عَدُوَّكَ مِنَ الْمُشْرِكِينَ فَادْعُهُمْ إِلَى إِحْدَى ثَلَثِ خِصَالٍ أَوْ خِلَلٍ فَأَيَّتُهُنَّ مَا أَجَابُوكَ إِلَيْهَا فَاقْبَلْ مِنْهُمْ وَكُفَّ عَنْهُمْ
When you meet your Mushrik enemy, then call them to one of three choices, and whichever they agree to, then accept it and turn away from them.
ادْعُهُمْ إِلَى الاِْسْلَمِ فَإِنْ أَجَابُوكَ فَاقْبَلْ مِنْهُمْ وَكُفَّ عَنْهُمْ
Call them to embrace Islam, and if they agree, accept it from them and turn away from them.
ثُمَّ ادْعُهُمْ إِلَى التَّحَوُّلِ مِنْ دَارِهِمْ إِلَى دَارِ الْمُهَاجِرِينَ وَأَعْلِمْهُمْ إِنْ فَعَلُوا ذَلِكَ أَنَّ لَهُمْ مَا لِلْمُهَاجِرِينَ وَأَنَّ عَلَيْهِمْ مَا عَلَى الْمُهَاجِرِينَ
Then call them to leave their area and come to areas in which the Muhajirin reside. Make known to them that if they do this, they will have the rights, as well as, the duties of the Muhajirin.
فَإِنْ أَبَوْا وَاخْتَارُوا دَارَهُمْ فَأَعْلِمْهُمْ أَنَّهُمْ يَكُونُونَ كَأَعْرَابِ الْمُسْلِمِينَ يَجْرِي عَلَيْهِمْ حُكْمُ اللهِ الَّذِي يَجْرِي عَلَى الْمُوْمِنِينَ وَلَاإ يَكُونُ لَهُمْ فِي الْفَيْءِ وَالْغَنِيمَةِ نَصِيبٌ إِلاَّ أَنْ يُجَاهِدُوا مَعَ الْمُسْلِمِينَ
If they refuse and decide to remain in their area, make known to them that they will be just like Muslim Bedouins, and that Allah's law applies to them just as it does to all believers. However, they will not have a share in the war booty orFai' (booty without war), unless they perform Jihad along with Muslims.
فَإِنْ هُمْ أَبَوْا فَادْعُهُمْ إِلَى إِعْطَاءِ الْجِزْيَةِ فَإِنْ أَجَابُوا فَاقْبَلْ مِنْهُمْ وَكُفَّ عَنْهُمْ
If they refuse all of this, then call them to pay the Jizyah, and if they accept, then take it from them and turn away from them.
فَإِنْ أَبَوْا فَاسْتَعِنْ بِاللهِ ثُمَّ قَاتِلْهُم
If they refuse all these (three) options, then trust in Allah and fight them.
Muslim collected this Hadith.
Allah said next,
وَإِنِ اسْتَنصَرُوكُمْ فِي الدِّينِ فَعَلَيْكُمُ النَّصْرُ
But if they seek your help in religion, it is your duty to help them.
Allah commands, if these Bedouins, who did not perform Hijrah, ask you to aid them against their enemy, then aid them. It is incumbent on you to aid them in this case, because they are your brothers in Islam, unless they ask you to aid them against disbelievers with whom you have a fixed-term treaty of peace. In that case, do not betray your treaties or break your promises with those whom you have treaties of peace.
إِلاَّ عَلَى قَوْمٍ بَيْنَكُمْ وَبَيْنَهُم مِّيثَاقٌ
except against a people with whom you have a treaty of mutual alliance;
This was reported from Ibn Abbas.
وَاللّهُ بِمَا تَعْمَلُونَ بَصِيرٌ
and Allah is the All-Seer of what you do.