Answer:
The answer is British colonialism
Step-by-step explanation:
South Africa had been set in a similar setting to most of Africa. The truth is that when more powerful Europeans set up, it's no doubt disease ravaged their populations. Not only this but years of whites settling there had begun to greatly increase white birth rates.
A major white presence in South Africa is seen with the boers. The boers were white settlers who has been settled in south Africa for generations, they were mostly Dutch. This population naturally expanded further and further, until decolonization.
Now it is important to know this is a very simplified version of South Africas rich history, completely ignoring the change in power in south Africa from Dutch to British during the napoleonic wars.
After WWII, the effects of colonialism was seen not only in south Africa but other former British colonies like Zimbabwe, formerly rhodesia, which underwent a civil war over whether or not blacks or whites should hold the power.
To put it simply, colonialism and an ever expanding white population in South Africa can make it confusing to see a pretty white African nation so close to majority black nations.
I hope this helps.