Also at this time, the Dharmashastras were composed. These codified the doctrine of varna and caste (jati).
In this doctrine, those who had better karma from past life were believed to be reborn into a higher caste.
According to the Dharmashastras, members of the top three varna classes (brahmin, kshatriya, vaishya) were to go through an additional Vedic initiation into adulthood.
For this reason, these three classes were known as dvija or “twice born.” The lowest castes (shudras and untouchables) were excluded from this.