In the book of Manusmriti (Indian Bible of sorts), is the beginning of humanity, and also the set up of Indian way of life. The head god Brahma divided himself into four parts establishing the social classes. Head became priests and teachers or 'Brahmins', the shoulders and arms were Kshatriyas or warriors and rulers because they actively worked to keep the peace and stability. The pelvis and legs became Vaishyas or farmers and merchants, they were the main part of the body. Shudras were the feet who were the laborers, they carried the whole empire around. There also was one class who went purposefully ignored, they were Dalits or the Untouchables, these are street sweepers, toilet cleaners, etc.
BBC News. "What Is India's Caste System?" BBC News. BBC, 25 Feb. 2016. Web. 17 Feb. 2017.
Brahmanism doesn't only explain the set up of castes, it also explains how humanity came about and is therefore, closely tied to religion. Indian beliefs of the time, (and even now) dictate that every person is in the constant state of reincarnation, and if one were to break away from it, they need to follow the demands of their social class to the best of their ability. If one is not following what they ought to for the social class, they will go back to being a lower class or lower creature in the next life. If one was a priest in this life, they did well in previous life.
Violatti, Christian. "Hinduism." Ancient History Encyclopedia. N.p., 11 May 2013. Web. 17 Feb. 2017.
Since 1950, it became illegal in India to oppress the Dalit, but with 160 million people falling into that category, and due to the fact that the caste system is also guided by religion, the oppression is ever present.
Dowling, Mike. "The Caste System at mrdowling.com". www.mrdowling.com. Updated July 11, 2016.