There is lot of confusion about caste. Hindu, birth in endogamous group, caste system is not the Varna system of Rig Veda and Gita. I give below an enlightened explanation of Varna by Swami Tapasyananda.
According to the aptitudes resulting from the dispositions of Nature
(gunas) and works (karma), the social order of fourfold division has
been created by Me. Though I am their originator, know me to be an
agent but the spirit unchanging.
Gita 4.13
Caturvarnya or the social order of fourfold division is not the caste system, which is a system of social grouping solely based on birth. Brahmana, Ksatriyas, Vaisyas and Sudra, as conceived in the Vedas, is a division based on the natural constitution of man arising from the dominance of Sattva, Rajas, and Tamas, the constituents of nature (Gunas), as also on the duties they are fit to perform according to the aptitudes arising from their constitution. They are mere character types. …………………..
Commentary on Gita 4.13 by Swami Tapasyananda in his English
translation of Srimad Bhagavad Gita
O great hero! The duties of Brahmanas, Ksatriyas, Vaisyas and also
Sudras have been divided according to the quality born of their own
nature.
[Gita 18.41]
Serenity, control of the sense, austerity, purity,
straight-forwardness, knowledge, insight, and faith in the Supreme
Being - these are a Brahman's duties born of his own nature.
[Gita 18.42]
Prowess, splendor of personality, unfailing courage, resourcefulness,
dauntless in battle, generosity, leadership - these are a Ksatriya's
duties born of his specific nature.
[Gita 18.43]
Agriculture, cattle-rearing and trade form the duty of the Vaisya
springing from his own nature, while the natural duty of a Sudra
consists in subordinate service under others.
[Gita 18.44]
A great doctrine of the social philosophy of ancient India, regarding
the fourfold class system, is here propounded. There has been no
doctrine so much misapplied, misunderstood and misrepresented as this
doctrine. The four Varnas of Brahmana, Ksatriyas, Vaisyas and Sudras
are today and for a long time past, understood as four hereditary
castes. But the Varnas, as understood by the best Indian thinkers, are
not castes based on birth in particular groups, but character types
based on the domination of the Sattvika, Rajasika and Tamasika
elements entering into the constitution of their body-mind, and this
is determined by their evolution in their past lives. At least such is
the Gita view. To have identified character types with endogamous
castes is nothing but an aberration. …….
These four character types are universal all the world over and the
prosperity of a society will depend on the man of the right nature and
character being put to the right type of duty. For the individuals
also doing the duty that is natural to his psycho-physical
constitution, is the way of higher evolution.
Commentary on Gita 18.41 to 18.44 by Swami Tapasyananda in his English translation of Srimad Bagavad Gita
By being devoted to one's own natural duty, man attains to spiritual
competency. Now hear how devotion to one's own natural duty generates
spiritual competency.
[Gita 18.45]
From whom all beings have emanated and by whom all this universe is
pervaded - by worshiping Him through the dedicated performance of
one's duty, man attains to spiritual competency.
[Gita 18.46]
These two verses (18.45–46) of the Gita link man’s social duties with
spiritual disciplines. By cultivating a special attitude towards work,
work is turned into worship, and the distance between the shrine room
and the work-spot disappears. This philosophy is based upon a
fundamental faith that this world and the progress of life in it are
all under the guidance of a Supreme Intelligence, who is the master of
it all, and whose will is expressed in all its movements. If man has
got this faith, man ceases to be self-centered. He comes to view
himself as a worker of God, and all that he does comes to be done with
a sense of dedication to Him. Such work accrues to one according to
one’s nature and is done with a spirit of dedication, is called
Svadharma, one’s natural duty. ………
A natural objection to this way of understanding Caturvarnyas is that
all commentators understood the four Varnas as endogamous groups
called castes and the ‘natural duty’ (Svadharma) of theirs as the
profession that was traditionally and scripturally alloted to those
groups under the four distinctive names. Such interpretations of the
Gita were given at a time when these endogamous groups were a
recognised feature of Indian society, and thinkers considered birth in
a group as tantamount to character type. The mistake of such
identification was obvious to many thinkers of the past. So many of
them have made amends by admitting that if great disparity in quality
is found in the actual quality of a Ksatriya with the traditionally
ascribed qualities, he can become a Brahmana. But all rationality
seems to have been neutralised by the very strong prejudice in favour
of endogamy.
…………………………..
But what the Lord speaks of here as Caturvarnya should never be
identified with castes, because the Varna is said to be solely
dependent on character formed by the Gunas of Prakriti. It is only an
ideal grouping based on psychological principle and not on rigid
hereditary basis.
Besides the Gita is a universal Gospel addressed to all mankind, for
all time, and not merely to the Indian society of a particular age. In
no part of the world except in India, caste system strictly based on
birth seems to have existed. Loose classes there have been, but no
rigid castes with unchangeable duties and occupations ………. So the old
commentators have done great injustice to Sri Krshna in watering down
the significance of his message as relevant only to members of the
rigid Indian social system.,,,,
Commentary on Gita 18.45–46 by Swami Tapasyananda in his English translation of Srimad Bhagavad Gita.
One's own duty, even if without excellence (i.e. inferior in the scale
of worldly values)is more meritorious spiritually than the apparently
well-performed duty of another. For no sin is incurred by one doing
works ordained according to one's nature.
[Gita 18.47]
This verse was interpreted by old commentators as jobs ascribed to particular castes. This verse is interpreted differently by those who follow Vivekananda's psychological explanation of Varna.
These verses, which were easy for our ancients to understand, pose
great difficulty for us today. So long as Varna was identified with
the endogamous caste, and valid texts ascribed particular works to
each caste it was easy to find out one's Svadharma, and if one had a
will, to perform it too. That a priest's son should be a priest, a
soldier's son a soldier, a merchant's son a merchant, an
agriculturist's son an agriculturist, a serf's son a serf - is an
arrangement that could be practised to some extent in the old feudal
society when educational opportunities were restricted, when there was
no choice in following professions, when social contacts were limited,
and when the validity of the system was accepted by the people in
general. But today such an idea of Svadharma hereditarily determined,
is impossible of practice. Society and professions have become
competitive. The imparting of education without any restriction
imposed by caste, has helped the shuffling of professional abilities
among all members of society, setting aside hereditary factors. So it
has become honourable for any one to follow any profession, and the
determination of Svadharma based on birth as in a caste based economy,
has become impractical and impossible, and also undesirable. In a
democratic society, the same kind of education is open to all, and
every one is eligible, according to one's qualification and capacity,
to positions of power, prestige and high income. In these days of
national armies every able-bodied citizen has the eligibility to be
recruited - he may even be conscripted - in the armed forces of the
country. In such a milieu, if the Gita idea of Svadharma is accepted
as caste based, as it was understood a few generations back, and as it
used to be interpreted by old commentators, then it has become
thoroughly outmoded and will be rejected by every section of society
in India and outside.
But as already pointed out, the wording of the Gita about Caturvarnya,
except as interpreted by old commentators, does not mean endogamous
castes, but the four psychological types. If this is accepted,
Svadharma would mean only work that springs out of one's own nature
and therefore adapted to one's natural development. But how to
recognise these types and how to provide them with work suited to
their nature - is a problem that cannot be solved. We have to leave
work based on psychological type as an ideal arrangement in a more
rationally organised society of the future. There is no other way
today but to understand Svadharma as the duty devolving on oneself in
society, inclusive of the profession one follows. If that is done well
with God in view, and not merely for remuneration or with a worldly
master in view, then one may be said to follow Svadharma.
Commentary on Gita 18.47 by Swami Tapasyananda in his English translation of Srimad Bhagavad Gita.
If you have come thus far then my sincere congratulations! I have not yet answered another question.
Why did the Varna system morph to the birth in an endogamous group based caste system?
Please go to the top of this post and reread Gita 4.13. One's Varna depends on past karma and guna. This raises an immediate problem. How can one know about one's past karma and guna so that the Varna can be ascertained? The short and sweet answer is that one can't. So what did ancient Hindus do about this problem? The answer is given below.
मङ्गल्यं ब्राह्मणस्य स्यात् क्षत्रियस्य बलान्वितम् । वैश्यस्य
धनसंयुक्तं शूद्रस्य तु जुगुप्सितम् ॥ ३१ ॥
maṅgalyaṃ brāhmaṇasya syāt kṣatriyasya balānvitam | vaiśyasya
dhanasaṃyuktaṃ śūdrasya tu jugupsitam || 31 ||
The name of the Brāhmaṇa should be auspicious, that of the Kṣatriya
connected with power, that of the Vaiśya associated with wealth; while
that of the Śūdra contemptible.—(31)
Manu Smriti 2.31
The ancient Hindus solved the problem of impossibility of determining Varna by outsourcing the problem to the parents. It, however, did not solve the problem. How can parents know the varna of the baby? Is the past karma and guna of the baby available to the parents? It is not so. What happened is that the parents considered the babies to be of the same Varna as themselves. This is how Varna system morphed into the present caste system.