Groups of people have a natural tendency to fall into layers of power, influence, opportunity and even closeness to the group. Groups of people have natural tendencies toward managing others into layers of power, influence, ability and even access to benefits of being in the group. In the mass of humanity, world changing layers of human stratification has come from colonization, governments, enslavement and profit taking.
Europeans began to explore the world, finding that they could manage whole civilizations into layers of power, influence, opportunity and closeness to society. This was based on appearance, usefulness, ability to resist and support for using force and power. As a result, the darkest skinned or the existing lower castes and classes were shoved or kept at the bottom or were forcibly maintained without full access to the benefits of society.
Then there was existing religious, political, social, inherited or tribal power, with the most powerful being less or more marginalized depending on their ability to wipe out Europeans or to negotiate better positions for themselves. There were women, who were not given much official power by any civilization, but who were seen more as varying levels of chattel, service, forced labor or breeding stock. Some societies had castes, as did European societies, where education, jobs, and opportunities were officially denied to those who were never supposed to rise up out of the servant or lowest classes.
There was profit, which Europeans wanted to accrue, first to themselves, then in decreasing increments to the layers of people they had created or maintained. This incremental decrease went on until there was only enough subsistence to support the lives of those who did most of the labor. The same went for education, opportunity to build independent businesses, the rights to own land and the ability to move freely as citizens. Enslavement was a convenient way to get labor, to oppress, and to enforce murder, eviction, relocation, destruction of culture, extermination and marginalization in order to reap the greatest profit at the least cost and for the longest time.
Generations of enslavement, with the help of completely corrupted organized religions and scientists, has led to permanent social stratifications that are proving impossible to end. The false science and religion has been taken far too seriously and incorporated so permanently that racism will never cease to be an issue. Social stratification will always include skin color, ethnicity and appearance as a factor in deciding who is chosen to be at the top, bottom or anywhere in between.
Thus, merit comes into play. Enlightened governments and societies discovered ways to give opportunity that is based on merit, rather than on biased subjective determinations. There is still much that is based on subjective determination and the darkest skinned or otherwise rejected invariably lose opportunity, power, education and closeness in those systems.
Profit does not always translate into wealth, but wealth, if well managed and sustained can translate into great power that goes on for generations. The ability of the wealthy to take on generational roles that are like royalty even in democracies. With sustained and generational wealth comes great and lasting power to influence governments, societies and economies as well as special privileges and powers that are not available to the other classes or layers of society.
The most stable democracies and civilizations have a majority of citizens who are in the middle class of incomes and who are stable throughout their working lives and retirements. The majority can either ignore them, or they can become concerned about those who are at the bottom of incomes and stability in life.
In a stable and solid economy with a lot of surplus, the majority may favor offering more help to those at the bottom, giving opportunity for education, getting jobs, starting businesses and owning property and becoming closer to society as a whole, but will withdraw that help when the majority loses their positions.
When income and opportunity is tipped over and much of the middle class joins the lower classes, then external reasons are far more likely to be blamed and attacked than internal factors. The idea of lower class is redefined and large populations adapt to a point.
The idea of an identifiable enemy or threatening force becomes refined and is usually assigned to defined groups of people, some of whom are pushed further to the bottom, out of the way or out of the society, as with deporting large immigrant populations or evicting or killing certain ethnic groups. The lowest classes then become social outsiders in greater numbers and in more ways than before.