Love of one's family and kin is a duty and a virtue in Islam, while tribalism ('asabiyya) in the blameworthy sense means siding with one's group even when it is wrong, and the Prophet (saw) condemned it.
- The Qur'an commands kindness to parents and relatives (4:36, 17:23) and also commands justice 'even against yourselves or parents and relatives' (4:135), so family love is limited by truth.
- The Prophet (saw) said that whoever fights under a blind banner, calling to group loyalty, dies a death of the Age of Ignorance (Sahih Muslim), and he told a Companion who insulted another man's mother that he was a man with ignorance in him (Sahih al-Bukhari).
- Ibn Khaldun used the word in a neutral sense for social cohesion, which can build a state, but he held that religion is needed to refine it.
- Scholars differ over how far a love of homeland or nation falls under this ruling, but agree that helping one's own people against justice is forbidden.
Introduction
The question asks about the difference between love of one's family and tribalism. It is an important question, because the two feel alike from the inside. A person who defends a cousin may be doing a duty or may be committing an injustice, and the same sentiment is behind both. The Islamic answer does not try to remove the natural love of family, which the Qur'an itself affirms, but sets the limit at which it turns into something blameworthy. The classical name for this is 'asabiyya, from the root meaning to bind or to wrap around.
This answer lays out the texts on kinship, the texts that condemn group partisanship, the explanation given by the scholars, and the way in which the word was used by Ibn Khaldun in a different sense.
The duty of family love
Islam does not ask a person to be cold to kin. The Qur'an says: 'Worship Allah and associate nothing with Him, and be good to parents, relatives, orphans and the poor' (4:36). It commands kindness to parents in the strongest terms (17:23 to 24) and warns against cutting the ties of kinship (47:22 to 23). The Prophet (saw) said: 'Whoever would like his provision to be expanded and his life extended, let him keep the ties of kinship' (Sahih al-Bukhari and Sahih Muslim, from Anas). A man complained that he kept ties with relatives who cut him off, and the Prophet (saw) told him to persist, saying that Allah's help would remain with him as long as he did so (Sahih Muslim, from Abu Hurayra). The Prophet (saw) himself showed love of family in his treatment of his uncle Abu Talib and of his grandchildren, and he made a place for kinship in the law of inheritance and of charity (the Prophet said that charity to a relative is two acts, charity and the keeping of ties, in Sunan al-Tirmidhi and Sunan al-Nasa'i, graded hasan).
There is also love of one's community and place. The Prophet (saw) loved Makkah, and when leaving it he said that it was the dearest land of Allah to him and that he would not have left it had his people not driven him out (Sunan al-Tirmidhi, graded hasan sahih). The scholars treat natural affection of this kind as permitted and rewarded when it leads to good.
The point at which it becomes tribalism
The line is crossed when love of one's own displaces the demand of justice. The Qur'an says: 'O you who believe, be steadfast in justice, witnesses for Allah, even against yourselves or parents and relatives' (4:135), and 'Let not the hatred of a people prevent you from being just. Be just; that is nearer to piety' (5:8). The Prophet (saw) said in a hadith in Sahih Muslim: 'Whoever fights under a banner of blindness, calling to group loyalty ('asabiyya) or becoming angry for it, and is killed, dies a death of ignorance (jahiliyya).' In a well known incident, a quarrel between a Muhajir and an Ansari led each to call on his own group, and the Prophet (saw) said: 'Leave it, for it is rotten' (Sahih al-Bukhari and Sahih Muslim, from Jabir). When Abu Dharr (ra) insulted a man by referring to his mother, the Prophet (saw) said: 'You are a man in whom there is ignorance' (Sahih al-Bukhari).
A hadith frequently quoted for the exact definition is that of Wathila ibn al-Asqa' (ra), who asked: 'O Messenger of Allah, is it tribalism that a man loves his people?' He replied: 'No, but tribalism is that a man helps his people in wrongdoing' (Sunan Abi Dawud and Sunan Ibn Majah). Its chain is considered weak by some graders, among them al-Albani, and it is therefore cited by scholars to illustrate the meaning rather than as a proof in itself, since the definition is supported by the sound texts above. The sound hadith in Sahih al-Bukhari gives the same sense: 'Help your brother, whether he is the wrongdoer or the wronged.' When the Companions asked how to help a wrongdoer, he replied that they should restrain him from wrongdoing, and this is his help.
The Prophet (saw) also removed the pride of lineage. In the farewell sermon, reported in Musnad Ahmad with a sound chain, he said that no Arab has superiority over a non-Arab, nor a non-Arab over an Arab, nor a white man over a black man, except in piety. The Qur'an says that peoples and tribes were made so that they may know one another (49:13), and the noblest is the most pious.
How the scholars explain the difference
Ibn Taymiyya in Iqtida' al-Sirat al-Mustaqim and elsewhere treats the 'call of the Age of Ignorance' as any call that sets people against one another by ties of descent, place or group in place of the religion and justice. Al-Nawawi, commenting on the Muslim hadith, explains 'blind banner' as a cause whose justice is not known to its holder and that is pursued out of partisanship. The distinction can be put briefly. Love of family is a feeling that leads to duty, such as support, visits and care. Tribalism is a judgement that treats the truth as dependent on who is involved. The first can be held together with justice. The second cannot.
A simple test, drawn from these texts, is to ask whether the person would take the same position if the roles were exchanged and the other party were of his own family. A person who would defend a cousin who has done wrong, but would condemn a stranger who did the same, is guilty of the thing condemned.
Ibn Khaldun and the sociological sense
Ibn Khaldun in his Muqaddima used the word 'asabiyya in a descriptive sense, for the solidarity of kin and groups that gives them the strength to protect themselves and to found a dynasty. He did not praise it without limit. He argued that the group feeling by itself leads to pride, rivalry and decline, and that the religious call unites people by drawing them above lineage, which is why the Prophet (saw) could bring the Arab tribes together. The word is thus used in two ways, one descriptive and one moral, and readers should not confuse a historian's analysis with the Prophet's condemnation.
Where scholars differ
Contemporary scholars differ on whether love of one's homeland or nation, as in modern nationalism, is blameworthy. Some, such as Abu al-A'la al-Mawdudi, criticised nationalism as a modern form of tribalism, and others, such as Yusuf al-Qaradawi, held that love of one's country is natural and permitted so long as it does not lead to disregard of Muslim brotherhood or justice. Both agree on the principle that helping one's own people in wrong is forbidden.
Conclusion
The difference between love of family and tribalism is not in the strength of the feeling but in its relation to justice. Love of family is a duty and a mercy, and Islam commands it. Tribalism is partisanship that supports one's own side whether it is right or wrong, and the Prophet (saw) condemned it. A believer can hold both loyalty to family and loyalty to the truth by following the Qur'an's command to be just even against relatives.
The best practice is to keep the ties of kinship fully while refusing to help any relative in wrongdoing.
References
Qur'an: 4:36, 4:135, 5:8, 17:23 to 24, 47:22 to 23, 49:10, 49:13
Sahih al-Bukhari and Sahih Muslim: chapters on kinship, on injustice, and on the Prophet's words on 'asabiyya; Sunan Abi Dawud, Sunan Ibn Majah, Jami' al-Tirmidhi: reports cited above; Musnad Ahmad: the farewell sermon
Ibn Taymiyya, Iqtida' al-Sirat al-Mustaqim; al-Nawawi, Sharh Sahih Muslim; Ibn Khaldun, al-Muqaddima