Availability of resources dictates location of settlements and their growth. Water is an essential for all life on the planet and is the most important resource. Geography and the climate determine how water is available at various locations and this dictates how life organizes itself and lives everywhere.
In India, its many perennial rivers were the only reliable source of water and humans settled along river valleys. The vagaries of the Monsoon rainfall made human life elsewhere only marginal.
As the density of population along such river banks began to increase, the human society there had to evolve ways and rules to live by and prosper together in harmony and to protect themselves and their properties from marauders. Such organization led to classification of the Society into groups responsible for various essential activities and the others who were just the others. Of course such others made up most of the middle class, the prosperity of which in any Society is the true measure of prosperity of that Society.
Compared to today, the relatively short life spans of those who lived then also compelled these others into sub-groups or jatis each of which sought to position themselves, so as to enable them to gain comparative advantage by doing what they each did best and establishing relationships with similar others in other locations. Such sub-groups soon developed specialist capabilities and contributed, as best they could, to their Society and all managed to live in greater prosperity, safety and harmony.
A proper understanding of how and why all this came about and functioned in the context of those times, will lead us to better understand and reposition ourselves differently in the context of the present times for even greater prosperity and better harmony.