Let’s again start with the (true) societal history of India in layman’s language; long long ago, ancient Hindus came up with an idea of dividing the society in four ‘Varnas’ being Brahmin, Kshatriya, Vaishya and Sudra.
Varna in sanskrit literally means ‘group’. Varna system basically came into existence on mere occupation basis. Varna vyavastha was not to be confused with caste system rather it was an organisational structure in the society. The division was based on individual temperament i.e. Varnas being assigned on the basis of aptitude and qualities of the individuals; where there were no restrictions in social relations and transfer from one Varna to another.
In Mahabharata (Anusasana Parva, Chapter 163) it is said: “O Devi, if even a sudra is actually engaged in the occupation and pure behavior of a brahmana, he becomes a brahmana. Moreover, a Vaishya can become a Kshatriya. Therefore, neither the source of one’s birth, nor his reformation, nor his education is the criterion of a brahmana. The vritti, or occupation, is the real standard by which one is known as a brahmana.” So it is not birth but one’s karma that decided his class.
The above excerpt can be summarised through an example: Suppose you are going for an interview in a company which has various divisions; you are hired for your qualifications and skills. If your father is a doctor, you do not have to be a doctor too, you can choose your career and that’s what Varna Vyavastha was i.e choosing and working in your own department according to your own choice and skills.
However, the definition of Varna Vyavastha (System) from late Vedic period to commencement of Brahminic period underwent a great change by misinterpreting the Varna with Caste (some texts even claim it was the colonization by British in 18th and 19th century which changed the Varna system into present day rigid system of castes). Hence, once an extremely flexible Varna system was replaced by a much rigid Caste system that changed the whole meaning altogether. Caste system which became prevalent now, decided castes of individuals by birth i.e.castes were forcefully inherited from parents to next generation. ( It is like even if you are a Raghuram Rajan, you have to sit down and chant shlokas than working on the Economy. What great loss.)
View of J. H. Hutton:
Hutton says that the concept of Varna is often confused with the concept of caste or Jati although caste and Varna have different meanings. The Varna seems to have been originally the four classes. In Vedic times, the line of demarcation between the various classes was not considered essential. A Kshatriya could become a Brahmana. At the time of Vedic invasion, the four Varnas represented a division of society into four classes, namely the Brahmanas who acted as priests, the Kshatriyas who were rulers, the Vaishyas who acted as priests, the Sudras who were the servant class.
(John Henry Hutton was an English-born anthropologist and an administrator in the Indian Civil Service during the period of the British Raj.)