As recorded history goes, South Africa is a young country, and that's because the original people, the San (also called Khoisan), had no written language and left only rock art. For centuries, they were protected by an east-west, coast to coast belt of deadly swamp full of malaria bearing mosquitoes, Tse Tse flies and poisonous water that isolated South Africa from the rest of the continent. The eventual southern migration of the Bantus from Central Africa pushed the hunter-gatherer Sans to less desirable land.
The Portuguese were the first white men to land in the Cape Town area on their way to India. Their swords and lances were no match against the greater number of Sans' wooden spears augmented with herds of charging cattle. The heavy casualty suffered at Table Bay (in today’s Cape Town) convinced the Portuguese to keep sailing around the horn of Africa and establish their bases elsewhere.
By the time the Dutch arrived about 150 years later, they had guns and the strength to push their way in. They came to settle and farm and were known as Boers (Dutch for farmers). Together with slaves from other parts of Africa and Far East along with Khoisan and protestant immigrants from France and Germany, they made up the Colored and Afrikaner populations of the Cape Town area of South Africa.
About another 150 years go by (until just before 1800) before the British captured Cape Town to protect the trade route and keep the strategic area out of the French hands. The Boers that did not care for British rule moved out of the Cape Colony toward the interior and came into contact with various tribes of the Bantus that had settled in areas north of the colony.
The fiercest of these was Shaka, king of the Zulus. Ironically he was able to make a technological breakthrough in war craft using iron from the Europeans to devise a short thrusting spear, suitable for repeated thrusts against the enemy and not just one heave and hope for the best. For a brief time, he even held the firearm equipped British soldiers to a standoff.
With the discovery of diamonds (1868) and gold (1886), all hell broke loose. The British had to get their hands on all that wealth from the ground. Some of the biggest diamonds from South Africa literally found their way to the crown jewel collection of the British throne. The British proceeded to fight the Zulus and the Boers to achieve hegemony over South Africa which they eventually accomplished. The different states were consolidated into the Union of South Africa, sometime in the early 20th century.
Seeds of apartheid were already sown by this time as segregation was widely practiced in the urban areas. The de facto practices were steadily formalized into laws and regulations by the white ruling class culminating into official policy of apartheid formed shortly after WWII.
There were two black heroes that wrestled Africa from the white ruling class. One was Robert Mugabe who won control of Rhodesia and turn it into Zimbabwe in 1980 and the other was Nelson Mandela who came to power in South Africa in 1994. Mandela has since stepped out of the limelight and bask in accolades showered on him as a senior statesman. Mugabe, alas, does not know when to retire and has earned worldwide scorn or even worse epithets.