Caste is a form of social stratification characterized by endogamy, hereditary transmission of a lifestyle which often includes an occupation, status in a hierarchy, and customary social interaction and exclusion. Its paradigmatic ethnographic example is the division of Indian society into rigid social groups, with roots in India's ancient history and persisting until today. However, the economic significance of the caste system in India has been declining as a result of urbanization and affirmative action programs. A subject of much scholarship by sociologists and anthropologists, the Indian caste system is sometimes used as an analogical basis for the study of caste-like social divisions existing outside India. The term is also applied to non-human populations like ants and bees.
The English word caste derives from the Spanish and Portuguese casta, which the Oxford English Dictionary quotes John Minsheu's Spanish dictionary (1599) to mean "race, lineage, or breed". When the Spanish colonized the New World, they used the word to mean a "clan or lineage." However, it was the Portuguese who employed casta in the primary modern sense when they applied it to the thousands of in-marrying hereditary Indian social groups they encountered upon their arrival in India in 1498. The use of the spelling "caste," with this latter meaning, is first attested to in English in 1613.
Modern India's caste system is based on the social groupings called jāti and the theoretical varna. The system of varnas appears in Hindu texts dating back to 1000 BCE and envisages the society divided into four classes: Brahmins (teachers, scholars and priests), Kshatriyas (warriors and nobles), Vaishyas (farmers,traders and artisans) and Shudras (service providers). The texts do not mention any separate, untouchable category in varna classification. Scholars believe that the system of varnas was a theoretical classification envisioned by the Brahmins, but never truly operational in the society. The practical division of the society had always been in terms of jātis (birth groups), which are not based on any specific principle, but could vary from ethnic origins to occupations. The jātis have been endogamous groups without any fixed hierarchy but subject to vague notions of rank articulated over time based on lifestyle and social, political or economic status. In many instances, as in Bengal, historically the kings and rulers had been called upon, when required, to mediate on the ranks of jātis, which might number in thousands all over the subcontinent and vary by region. In practice, the jātis may or may not fit into the varna classes and many prominent jatis, for example the Jats and Yadavs, straddled two varnas i.e. Kshatriyas and Vaishyas, and the varna status of jātis itself was subject to articulation over time.