Caste -- apartheid as religion
The population has long been organized into thousands of hereditary endogamous clan-like units (jâti) associated with specific types of work, grouped into four overall categories (varna) which, in order of rank, are:
1) Brahmin (priests) -- not surprisingly, a religion-based system puts priests at the top
2) Kshatriya (nobility and warriors)
3) Vaisya (craftsmen, traders, farmers)
4) Shudra (common laborers)
The "untouchables", the lowest of the low, are those who are outside the caste system altogether, not included in any of the four groupings.
The Rig Veda attributes the system to divine origin, the four major castes being created separately. As best we can tell, the system actually dates back to the Aryan conquest of India almost 4,000 years ago, which destroyed the ancient Indus Valley civilization and began a period in which the descendants of the invaders formed a distinct ruling class. It seems likely that the caste system developed from a religious codification of this racial hierarchy, rather as if South African apartheid had evolved into a religion. Even today, people of higher caste are typically lighter-skinned than those of lower caste, though after thousands of years this is only a general tendency rather than a firm correlation, and a pervasive social bias in favor of lighter skin is attributed to the influence of the caste system. Interestingly, the original literal meaning of the word varna was "color".
There's some evidence that in the distant past the system was less rigid than today, but in modern times caste membership is determined by birth. The true genius of caste lies in its combination with two other Hindu religious concepts, reincarnation and karma, the latter referring to the effects of an individual's actions in life which are rewarded or punished by a higher or lower reincarnation after death. In brief, those who are born into a high caste earned it by their virtue in previous lives, while the low-born are similarly being punished for misdeeds in earlier incarnations. No matter how outrageously unequal, the social order is actually perfectly just, giving each person their due. If one accepts the view of some scholars such as Jared Diamond, that each society's religion developed largely to justify the position of its ruling class, then Hinduism must be the most fiendishly brilliant religion ever devised.
Again, modern Indian secular law does not recognize caste and prohibits caste discrimination. But entrenched religious thinking in great masses of people is notoriously difficult to change, especially in societies where modern education is not widespread. Like the racial hierarchy in the US in the pre-Civil-Rights era, the religion-based caste hierarchy is sometimes enforced by brutal violence against those who "do not know their place". Many of the vicious gang rapes and rape-murders which have lately caught the attention of the Western media fall into this category, with either the victims or their male relatives having previously said or done something which local higher-caste people deemed inappropriate. Like the lynch mobs of our own history, it's basically enraged dumb hicks beating down those even lower in the pecking order than themselves, but with religious tradition adding feelings of self-righteousness about it.
As modernity has exposed the hypocrisy and sleaze of Western religious institutions, some Westerners have turned their "spiritual" cravings toward the supposed mystical wisdom of eastern religions. But humans are humans wherever they live, and the reality of religion is just as ugly.