South Africa's system of apartheid was designed, not only to protect the privileges of the affluent, but to improve the desperate situation of "poor whites." Apartheid reserved decently paid skilled and semi-skilled manual jobs for them, making it possible for almost all whites to achieve a good life - a house, a car, steady employment, holidays at the beach, servants.
South Africa wasn't the first country to adopt such strategies. As every child learns in school, Canada made way for European settlement by expropriating land from native peoples and settling them on reserves. Less well known are the laws designed to protect whites from other forms of labour market competition - the complete exclusion of all Chinese immigrants starting in 1923, and British Columbia laws preventing Chinese Canadians from entering professions such as law, pharmacy or and accountancy (see here).
Nor was South Africa the last country to choose the path of exclusion. China's hukou system, formalized in 1958, shares key elements with apartheid. It, too, classifies people on the basis of who their parents are, and where they were born. It restricts where people can live and work. If a rural peasant wishes to come to Beijing and Shanghai and make a better life for herself - well, it's possible, just as illegal immigration is possible - but she will not be able to send her child to school, let alone buy property or establish a business. It's tough on people in the countryside, but it protects city folk from mass migration, crowding, and competition for jobs.
Apartheid and racist legislation is the wrong answer to the problem of poverty. But what's the right one? Levels of inequality are high and rising. The Occupy movement is driven by those who aspire to a middle class life, but are struggling (and sometimes failing) to keep themselves above the poverty line.
Education is one answer: more human capital = higher productivity = higher wages = a better life. A guaranteed annual income is another. Unionization and minimum wages are another strategy: to force companies to pay workers a living wage. (A strike by farm workers here in South Africa has just led to a substantial increase in wages).
All of these alternative answers have their critics. Education only results in erudite barristas. A GAI is unaffordable, and/or benefits employers by subsidizing (thus putting downwards pressure) on wages. Unions and minimum wages raise unemployment and decrease competitiveness.
Yet Apartheid shows, whatever the limits of such policies may be, what the consequences of a despairing and disenfranchised lower middle class can be. As the saying goes, a politician who robs Peter to pay Paul can always count on Paul's vote.
Apartheid was an electoral winner in South Africa, in part, because the people oppressed by the system didn't have a vote. Also, in South Africa, as in Canada, rural votes have relatively more weight than inner city votes (because there are fewer voters per riding in rural areas). Even though the Nationalist (pro-Apartheid) Party did not initially command a majority of the white vote, it gained power by appealing to rural voters.
Excluding outsiders, and promising jobs for insiders, will always win some votes.