Although Islam does not recognize any castes, Muslim communities in South Asia apply a system of social stratification. It developed as a result of ethnic segregation between the foreign conquerors (Ashraf) and the local converts (Ajlaf), as well as influence of the indigenous Hindu culture.
Islam does not recognize any castes, but, when it came to Persia and India, the existing divisions in these regions were adopted among the local Muslim societies. Evidence of social stratification can be found in several later Persian works, such as Siyasatnama of Nizam al-Mulk (11th century), Akhlaq-i Nasiri of Nasir al-Din al-Tusi (13th century), and Jam-i-Mufidi (17th century).
The Muslims who came to the subcontinent during the 12th century Muslim conquest of India were already divided into social classes such as priests, nobles and others. Further, a racial segregation demarcated the local Muslim converts from those of foreign origin. The foreigners claimed a superior status as they were associated with the conquerors, and categorized themselves as Ashraf ("noble"). Over time, the Indian Muslim society also split on the basis of the existing Hindu caste system. According to M. N. Srinivas (1986), Indian Hindu converts to Islam brought their original caste system to the Muslim society in the region. On the other hand, Louis Dumont (1957) believes that the Islamic conquerors consciously adopted the Hindu caste system.
Ziauddin Barani, the 14th century political thinker of the Delhi Sultanate recommended that the "sons of Mohamed" (i.e. Ashrafs) be given a higher social status than the low-born (i.e. Ajlaf). His most significant contribution in the fatwa was his analysis of the castes with respect to Islam. His assertion was that castes would be mandated through state laws or "Zawabi" and would carry precedence over Sharia law whenever they were in conflict. According to Barani, every act which is "contaminated with meanness and based on ignominity, comes elegantly [from the Ajlaf]". Barani also developed an elaborate system of promotion and demotion of Imperial officers ("Wazirs") that was primarily based on their caste.