The brahmin, ksatriya, vaisya, and sudra castes originated from the body of Brahma, according to the Rigveda. The later purusha (cosmic man) myth posited their origin from the self-sacrifice of the “first man,” god creating by self-division. By the late Vedic period four castes, instead of three, and a definite hierarchy with the brahmins at the top had been firmly established. The first three castes were twice born, leaving the sudras without a second or ritual birth. Therefore, sudras could be not eligible to study Sanskrit or learn the Vedas and the accompanying rituals.
Caste is an unhappy translation of varna, as varna is the ancient ideal social system of Vedic religion whereas “caste” refers to actual jati (birth) system of today. The myths mix praise of varna dharma (the ideals of an ordered and righteous society) with criticism of a mixing of races and groups that reflects a decline of society into the moment that another destruction will be inevitable.
The varna-asrama-dharma system is addressed in chapter 1 in the sections on “Hindu Worldviews” and “Dharma.”