they migrated from Mecca to Medina...
they migrated from Mecca to Medina, and those who gave shelter to the Emigrants and helped them in war against their enemies, i.e. Ansar (the Helpers), inherit each other. The Emigrants and the Helpers inherited from each other because of the brethren contract they concluded from the beginning with each other until the time when this matter was abrogated by Surah Al-‘Anfal, No. 8, verse 75, which says: “...and the blood relatives are nearer to each other...”.
If the believers who did not migrate ask you to help them for the sake of the religion of Allah against infidels, you should help them, except for the group of infidels who have concluded the agreement of non-opposition with you. In this case you cannot help the Muslims in war against them.
The verse says: “Verily those who believed and migrated and strove with their properties and their selves in the way of Allah, and those who gave shelter and helped (the strivers), those are friends one of another. And those who believed but they did not migrate, you have not any friendship towards them until they migrate.
If you do not so, there will be confusion in the earth and a greater mischief.”*** The meaning of this verse is that Muslims should refrain from being friends of infidels and helping them, though they may be their close relatives. They should leave out their guardianship, too. If you do not do what Allah (s.w.t) has commanded you, there will appear a great confusion and a great mischief in the earth.
That is, if you do not settle a relation of brotherhood between yourselves, and some of you do not take one another as guardians, even by inheriting from each other, and do not prefer the connection of Islam to the connection of relationship, nor cut off the communication between you and pagans, you will confront a great confusion and mischief in the earth.
For, as long as Muslims are not untied before infidels, polytheism will remain and pagans will be bold upon Muslims and will call them towards infidelity. The verse says: “And (as for) those who disbelieve, they are friends one of another.