At one time, in ancient india, they were frozen into the castes. The idea was there are certain distinctions in our make up that led to the arwarnadharma. Then you have a combination of warna samadherma and vishe shad herma. This is based on guna karma, your mental make up and your activities in society. You can see indian society is sort of riven and fractured on these lines. But the original idea was this, and you have it on christna's own words.
Q&A session lead by Swami Sarvapriyananda at the Vedanta Society of New York on Nov 7th, 2021. List of questions with timestamps:
05:10 - What happens to the reflected consciousness after death, and after enlightenment?
19:10 - What is my swadharma?
35:20 - What is the difference between the knower and the witness?
41:20 - Where does Sri Ramakrishna stand in the triad of Iswara, Jiva, and Jagat?
51:15 - Is enlightenment a gradual process or a “wow” moment?
01:02:40 - What is Shraddha?
01:15:33 - Is there any overlap between psychotherapy and Vedanta?