About 8 months back, I went to South Africa. I did try to learn a bit about the country before going there. I was very much surprised to learn that 'Apartheid' was a thing/practice till Nelson Mandela's release from jail in 1992. From what little I could garner in my brief time is that both countries (India and South Africa) was annexed/taken over by other countries multiple times.
I could not figure out why the two countries differed in the final outcome. While India was able to become a Self-Independent state in 1947 (for Indians, by Indians) South Africa is still ruled by minor European people (they were repeatedly annexed by both Britain and Holland/Dutch successively over centuries).
The strategies employed by both countries are similar. We, Indians used a mix of non-violent passive-resistance (Gandhiji and the Gandhian movement) and violent resistance (Subhash Chandra Bose, Bhagat Singh, Chandrashekhar Azad and many others). For South Africans they had Nelson Mandela and I'm sure there were people who took violence as a way to gain independence.
What differences or factors could be attributed for the way history became in the two countries ?