Once Buddha was staying in Savatthi at the mansion of Migara's mothers in the East Park when he gave this discourse to Vasettha and Bharadvaja. Vasettha and Bharadvaja were living among the monks, hoping to become monks themselves. Buddha said to Vasettha: "Two of you are brahmins born and bred, and yet you have gone forth from the household life into homelessness from Brahmin families. Don't the Brahmins revile and abuse you?' Vasettha replied: 'Indeed, Lord, the Brahmins do revile and abuse us.' Buddha: 'Well, Vasettha, what kind of reproaches do they fling at you?' Vasettha: "The Brahmin said that they are the highest caste, other castes are base; the Brahmin caste is fair, other castes are dark; Brahmins are purified whereas non-Brahmins are not, the Brahmins are the true children of brahma born from his mouth unlike other lower castes. They reprimanded us for deserting the highest class and gone over to the lowest class of shaveling petty ascetics, servants, dark fellows born of Brahma's foot! They said it's not right for us to mix with such people!"
Then Buddha used this sutta to explain the evolution of human society, development of kingship and the origin of occupations not caste. To Brahmin's remarks to Vasettha, Buddha told them that the Brahmins have indeed forgotten about their past if they said such things. He mentioned that brahmins, ksatriyas, vessa and sudras are not born from Brahma the creator but rather from their mothers' womb like anyone else. This means that brahmins who claimed themselves to be born from the mouth of Brahma the creator is scientifically untrue and not possible. These Brahmins misrepresent Brahma, tell lies and earn much demerit. He added “None is by birth a bhramin. None is by birth an outcast. By deed (virtuous and morality) one becomes a Brahmin. By deed one becomes a outcaste." The Buddha then elaborates that if any of the castes does the following unwholesome deeds: killing, taking anything that is not given, sexual misconduct, lying, slandering, speaking harsh words or gossips, greedy, cruel, and practice wrong view then the wise people would still see that they do negative deeds and therefore are not worthy of respect. They will even get into trouble from their own deeds, whatever their caste (Brahmin, Khattiya, Vessa, and Sudda) might be.
If any of the castes refrain from killing, taking anything that is not given, engage in sexual misconduct, lying, slandering, speaking harsh words or gossip, being greedy, cruel, and practicing wrong views, will be seen by wise people as positive and will earn respect from them. They would be profiting from their deeds, no matter what their caste might be.
Buddha continued: 'Now since both dark and bright qualities, which are blamed and praised by the wise, are scattered indiscriminately among the four castes, the wise do not recognize the claim about the Brahmin caste being the highest. Why is that so? It is because, Vasettha, anyone from the four castes who becomes a monk, an Arahant who has destroyed the corruptions, done what had to be done, laid down the burden, reached the highest goal, destroyed the fetter of becoming (rebirth) and become emancipated through super-knowledge. Then he is proclaimed supreme by virtue of Dhamma. Dhamma's the best thing for people In this life and the next as well. '
Buddha then gave an illustration to show that Dhamma is indeed the best thing of all things in life. He gave the example of King Pasenadi of the Kosala Kingdom, who has now conquered the Sakyans. The Sakyans praise, and serve him with respect. But towards the Buddha who was a Sakyan, King Pasenadi reveres, praises, and serves the Buddha with utmost respect. King Pasenadi thinks like this: "The Ascetic Gotama had perfect birth, while I am not perfect. The Ascetic Gotama is mighty, while I am weak. The Ascetic Gotama is pleasant too look at unlike me. The Ascetic Gotama is influential and charming, while I only possess small influence." It is because of honoring the Dhamma, esteeming the Dhamma, paying reverent homage to the Dhamma that King Pasenadi does humble service to the Tathagata and pays him fitting service.
Buddha: 'Vasettha, all of you, though of different birth, name, clan. and family, who have gone forth from the household life into homelessness, if you are asked who you are, you should reply: "We are ascetics, followers of the Sakyan. He whose faith in the Tathagata is settled, rooted, established, solid, unshakeable by any ascetic or Brahmin, any deva or mara or Brahma or anyone in the world, can truly say: "I am a true son of Blessed Lord, born of his mouth, born of Dhamma, created by Dhamma, an heir of Dhamma." Why is that? Because, Vasettha, this designates the Tathagata: "The Body of Dhamma", that is, "The Body of Brahma", or "Become Dhamma", that is "Become Brahma".
The beginnings
(The Agganna Sutta unravels the origins of the social division of labour. The word agganna literally means with knowledge of beginnings. Buddhism not relying on an almighty creator, traces the evolution of human society along with state and kingship without any reference to the intervention of a creator god. This opposes the Brahmins’ theory on a creator god (brahma). Buddha also uses Dependent origination to explain the inter-connectedness, cause and effect, which leads to rebirth in samsara.)
Buddha explained that "'There comes a time, Vasettha, when, after a long period, this world contracts. At a time of contraction, beings are mostly born in the Abhassara Brahma world. The beings were made of mind, fed on bliss and joy, self-luminous, travel across the air and were glorious and they stay like that for a very long time. But sooner or later, after a very long period, this world begins to expand again. At a time of expansion, the beings from the Abhassara Brahma world passed away and are mostly reborn in this world. Here they dwell, mind-made, feeding on delight, self- luminous, moving through the air, glorious and they stay like that for a very long time. At that time, it was pitch darkness all over with no sun or moon, no day or night.
Some of the beings who had curiosity and a greedy nature began to dive and taste the savory Earth's substance. Soon greed and craving entered the hearts of these beings, resulting in the fading away of their luminescence. Due to taking solid food, their bodies became more solid and their complexion changed, some dark and some fair. The beings then look different in terms of complexion and looks. As some are better looking, they become arrogant and being envious by the lesser looking. Later on the sun and moon came out, day and night become obvious, seasons and years also appeared.
Evolution
They fed on whatever they found the earth provides from stage to stage. When there were rice plantations, they took rice and store the rice as they become lazier. Usually, it took only one night for the plant to grow and be ready to be consumed, but by the karmic power the plant began to grow more and more slowly. The sutta continue to relate how they evolve from one stage to another by building a civilization on Earth.
During this evolution, the body of the creatures had become finely evolved. There was clear distinction between male and female. The man became preoccupied with women and vice versa. Their passion and desire was aroused, and they engaged in sexual relationships. The people who saw a couple engaged in sexual activity scolded them, and usually the couple were forbidden from entering the village for a certain period of time. Owing to this, the indulgent couples built closed dwellings where they indulged in sexual activity.
Social Decline
Under new conditions, it was no longer clear who was entitled to what. They moved from primitive food-gathering stage shifting from place to place to a stage of food production by partition and cultivating lands. They claimed private ownership of lands, put up boundaries across previously common property/ Organizing themselves as husbands and wives, shelters were put up to enable them to lead private lives. Instead of the original clan, the separate household became the basic unit of the new society. Instead of restoring peace, the right to private property further inflamed greed and craving to accumulate wealth. This resulted in increased theft, stealing of private lands, lying, sexual misconduct and violence. Morality began to deteriorate resulting in the disturbance of peaceful co-existence.
Rulers’ Titles
Evil acts were rampant and culprits could not be corrected just by stern warning or mere nominal punishment. It was at this stage when people got together and appoint a central institution (ruler) to regulate social affairs. So they went to the one among them who was the handsomest, the best-looking, the most pleasant and capable, and asked him to do this for them in return for a share of the rice and he agreed.The first and enduring ruler title was Mahajana Sammata or The Great Elect. The title was for someone acting like an executive who looked after the law and order among the community. Being impartial, he punished those who transgressed the customs and traditions of the community. In this sense, he was considered an authority of law and justice. Note that the institution of The Great Elect is not a creation of Brahma as brahmins claimed but a democratic system.
The second title and constituting element was Khattiya which originally meant Lord of the Fields. He was given powers of overlord-ship (people of great influence) but not rights of proprietorship (owner of industry) over the people or lands.
The third title and constituting element was Raja or King because he ruled the country in accordance with Dhamma which is law and justice as well as righteousness. Here his authoritarian power expanded further.
This is the origin of the class of Khattiyas, in accordance with the ancient titles that were introduced for them. They originated among these very same beings, like ourselves, no different, and in accordance with Dhamma, not otherwise.
Brahmins' titles
Some of these beings thought: "Evil things have appeared among beings, such as taking what is not given, censuring, lying, punishment and banishment. We ought to put aside evil and unwholesome things." And they did so. The first title given to someone who avoid unwholesome acts and thoughts, they act in accordance to dhamma and was called the Brahmin. They live in huts in forests and meditate in them leading the homelessness lives. They gather food by alms round.
Some of these ascetics will go to the village, city or town to get food from alms round in the day and then return to their dwellings later to meditate. The villagers noticed how they meditate and called them "Jhayaka" ( they meditate) which is the second regular title given to them.
Some of these ascetics cannot concentrate on meditation, they settled down in towns and villages to write dhamma books instead. The people call them " Ajjhaya" ( those who do not meditate) and that is the third regular title introduced.
This is the origin of the class of Brahmins in accordance with the ancient titles that were introduced for them. Their origin was from among these very same beings, like themselves, no different, and in accordance with Dhamma, not otherwise.
The Vessa (Traders) and the Sudda (Hunters)
Among the people who had settled and had family, some began to adopt various trades. "Various" is the meaning of Vessa thus these people are called the Vessa and that was the origin of the title given to them. The remainder of these people preferred the work of hunting. The Sudda caste came from the word 'Sudda' which means: 'They Are Base Who Live By The Chase' and thus that was the origin of the title given to them. All of the castes, from Brahmin, Khattiya, Vessa, and Sudda originated from these people, and not from others; in accordance to the Dhamma and not by others.
The Ascetics
From the four clans, there were people who were not satisfied with their living, left their home(went forth from the household life into homelessnes) and became celibate ascetics. These are the origin of the fifth caste formed from all the four castes' people who left their lay life and became an ascetic. Their origin was from among these very same beings, like themselves, no different, and in accordance with Dhamma, not otherwise.
No distinction between the "Castes"
Buddha told Vasettha: "A Khattiya who has led a bad life in body, speech and thought, who has wrong view will and in consequence of such wrong views and deeds, at the breaking- up of the body after death, he will be reborn in a state of loss, an ill - fate, the downfall, the hell-state. So too will a Brahmin, a Vessa or a Sudda. (No difference in the caste). Likewise, a Khattiya who has led a good life in body, speech and thought, who has right view will, and in consequence of such right view and deeds, at the breaking-up of the body after death, be reborn in a good destiny, in a heaven- state. So too will a Brahmin, a Vessa or a Sudda. (No difference in the caste). "
Buddha continued: "A Khattiya who has performed deeds of both kinds in body, speech and thought, and whose view is mixed, as a consequence of such mixed views and deeds, at the breaking-up of the body after death, will experience both pleasure and pain. So too will a Brahmin, a Vessa or a Sudda (No difference in the caste) . Also a Khattiya who is restrained in body, speech and thought, who has developed the seven requisites of enlightenment, will attain to Parinibbana in this very life. So too will a Brahmin, a Vessa or a Sudda (No difference in the caste).Whichever caste a monk, comes from, if he becomes an Arahant who has destroyed the corruptions, done what had to be done, laid down the burden, attained to the highest goal, completely destroyed the fetter of becoming, become liberated by the highest insight, he is declared to be chief among them in accordance with Dhamma, and not other- wise. "
The Buddha quoted, "Dharma is the best thing for people In this life and the next as well." The Buddha quoted the verses of Brahma Sandakumara: "The Khattiya is the best among those who maintain their lineage;He with knowledge and conduct is best of gods and men." then, the Buddha asserted that the verse is indeed true, according to the Dhamma, profitable, and true.
At the end of this discourse, Vasettha and Bharadvaja were delighted and rejoiced over the words of Buddha.
In summary, in this discourse Buddha defines the origin of the 4 castes according to their occupations/ trades : Ksatriya (king and warriors), Bhramanas (priests) , Vaisya (traders) and sudra ( hunters or lower pursuits) rather than defining by what the brahmins mentioned i.e. Brahmin is born from Brahma's mouth. Buddha also mentioned that all four castes are on equal footing, everyone has equal capacity to attain liberation/nibanna. Anyone from any caste who has led a good life in body speech and thought (Kamma), with the right view will be reborn in good state. Likewise anyone from any caste who has led an unwholesome life, with wrong view will be reborn in a bad state. There is no special "treatment" or "exception" to the "higher castes", which means all are equal. Buddha also mentioned the evolution of society and beginning of kingship in this sutta.
References: 1. www.accesstoinsight.org 2. https://suttacentral.net/ 3. The long discourses of the Buddha (Bhikkhu Bodhi)