In The Name of Allah, The Most Merciful, The Bestower of Mercy.
If you examine the circumstances of people prior to the advent of Prophet Muhammad [peace and blessings of Allah be upon him], whether they were Egyptians, Persians, Romans, or Arabs in Makkah and the surrounding areas, people from the Arabian Peninsula, people who lived in Syria and Iraq, or people in Egypt and its neighbours, you will find that deprivation of liberties and denial of equality was prevalent; rather, it was (a situation of) the law of the jungle, so the strong (oppressed, terrorised, etc) the weak and the people subjugated one another. As a result, when the Persian ruler asked (the Prophet’s companion) Rabee [may Allah be pleased with him], “You are Arabs, so what brought you to the land of Persia?” He replied, “Indeed, Allah sent us to remove the one He wishes to be removed from the worship of the servants and direct them towards the worship of the Lord of the servants, in order to remove them from the distress of the worldly life to the happiness of the worldly life and the Hereafter”.
The Prophet [peace and blessings of Allah be upon him] was sent, the Islamic Shariah was revealed to him, and Allah commanded him to declare the truth, warn his closest relatives, and eventually all the people. Allah made his message a mercy for all of creation. Allah said: [وَمَا أَرْسَلْنَاكَ إِلَّا رَحْمَةً لِلْعَالَمِينَ – And We have sent you (O Muhammad) not but as a mercy for the ‘Alamin (mankind, jinns and all that exists)]. [Surah Al-Anbiyaa. Ayah 107]
Class conflict and distinction were prevalent in that society when the Prophet emerged (as a Messenger); this tribe is superior to that tribe, these are superior, these dominant over others, and other similar tribal norms that discriminated and gave preference to some over others. So, the Prophet approached them with a mighty principle and that is the statement of Allah:
يَا أَيُّهَا النَّاسُ إِنَّا خَلَقْنَاكُمْ مِنْ ذَكَرٍ وَأُنْثَى وَجَعَلْنَاكُمْ شُعُوباً وَقَبَائِلَ لِتَعَارَفُوا إِنَّ أَكْرَمَكُمْ عِنْدَ اللهِ أَتْقَاكُمْ
O mankind! We have created you from a male and a female, and made you into nations and tribes, so that you may know one another. Verily, the most honourable of you with Allah is that (believer) who has more fear of Allah. [Surah Al-Hujuraat. Ayah 13]
Thus, honour, virtue, and distinction were attributed to the person who fears Allah the most, rather than to someone because of their gender (see footnote a), skin colour, tribe, or nationality (see footnote b). Instead, Allah attributed virtue to people based on their level of piety. [إِنَّ أَكْرَمَكُمْ عِنْدَ اللهِ أَتْقَاكُمْ – Verily, the most honourable of you with Allah is that (believer) who has more fear of Allah].
Our Prophet [may blessings and peace be upon him] said, “There is no superiority for an Arab over a non-Arab, except based on piety”. [As-Saheehah. 6/199]
People are equal in the same way that comb teeth are equal. This is well-known in terms of the obligations that are obligated to everyone who has reached the age of responsibility. Allah created everyone equal, which means that His divine revelation is intended for everyone – male and female, free and slave, rich and poor, regardless of their social station. Everyone is commanded to worship Allah alone, to obey His commands, and to fear Him to the best of their abilities. This is the equality that everyone is commanded and held accountable for. Similarly, when Islam arrived, the rift and animosity amongst the people ceased, and the affair alternated into a close brotherhood. The Prophet [may Allah’s peace and blessings be upon him] fostered and developed a brotherhood between the Muhaajiroon [Makkah migrants] and the Ansaar [Madeenah’s indigenous residents]. This, without a doubt, demonstrates the absence of differentiation and goes beyond fulfilling a person’s rights or giving something to a person because they are a child of Adam and that all humans are equal in Sight of Allah- equal in the fulfilment of rights and obligations amongst themselves. [Listen here: https://video.link/w/j4azb paraphrased]
Footnote a: Gender, which should not cause confusion or debate, has become one of the battlefields where everyone who wants to be heard shares their viewpoint, even if their beliefs directly contradict or violate the Creator’s commands and prohibitions. Here is a very useful article by Shaikh Dr. Abu Iyaadh [may Allah preserve him]. https://abuiyaad.com/w/gender-etymology
Footnote b: Benefit from this clarification By Shaikh Abu Khadeejah [may Allah preserve him]: https://www.salafisounds.com/racism-forced-marriage-with-islaam-by-abu-khadeejah/