I don't understand how a country with a population smaller than London could become so influential in the history of South Africa which had a population 4 times bigger.
I know SA had considerable resources in diamonds and gold, but why did the Dutch need to rule and control the country through such violence and force, creating apartheid and finally leaving politics in the mid-1990s?
The Dutch lost control of the Cape Colony permanently under treaty terms in 1814, at which point it became a British colony. At that point, the British had occupied it since 1806; before that, the semi-puppet Batavian Republic had run it from 1803 to 1806, and the British had occupied it from 1795 to 1803. The Dutch East India Company (not The Netherlands proper) ran the colony--and I use the term 'ran' very loosely--before that time. So it was never in fact within the direct power of a Dutch government unless one considers Napoleon's allies to be legitimate.
Confusion arises when one sees "Dutch" used to describe the Africanders/Afrikaners/Boers and various subdivisions of those identities, but they are the descendants of the freeburghers and other Dutch, German, French, and Scots/Irish rural freeholders and urban merchants and laborers who were there in the VOC (East India Co) era. Some came later, after the British takeover and the mid-century establishment of largely autonomous settler 'republics' (Transvaal or ZAR, and Orange Free State) inland under the rule of those same "Dutch," or Boers in that context, but their entry to this "Dutch" label was not automatic. Thus the first part of the question seems to be predicated on a misunderstanding; it was not the Dutch as a nation so much as the Dutch as an economic entity, and in the latter sense they were one of the greatest global powers of the 17th and early 18th centuries. Although it's old, the discussions of Company rule in Elphick & Giliomee, Shaping of South African Society 1652-1840 (Wesleyan, 1989) are still remarkably good. More recent work from the Nigels (Worden and Penn) and the indefatigable Karel Schoeman (when in English) is always good.
The second question has a different sheen in light of the answer to the first, and I'm not sure how to bend it. However, I will point out that one common theme in the discussions of the so-called 'native problem' in the 19th century and the 'swart gevaar' (black peril) of the 20th is the fear of being swamped. Violence and force make more explanatory sense when you realize that the Highveld republics where minerals were and, later, the Union of South Africa were not appendages of a particular colonial power despite being settler colonies themselves throughout. As a population that never exceeded 20% of the total of the subcontinent, white South Africans generally (and the 2/3 of those who were former "Dutch" or Afrikaners) tended to prefer suppression and the monopolization of violence to concession or sharing power with the majority. Liberalizing moves in the British colonies (Cape, Natal) towards assimilation and franchise extension were reversed when the unified nation after 1910 came under increasing control by those same fearful white settlers. Although a tiny minority, the vast majority of the electorate was white throughout the country, and appeals to the dangers of sharing power and the 'swart gevaar' were enough to assure votes.
The SA War (1899-1902) was fought in part to bring the Republics into a British fold, and the Dutch government, while professing sympathy with the Boers in matters of mistreatment, in fact supported the right of Britain to treat the Boer republics as rebellious colonies, run by British subjects it had never relinquished (though the Boers totally disagreed with that idea). The Dutch only involved themselves directly to offer the President of the ZAR/Transvaal, Paul Kruger, asylum in exile, and send a ship to get him (with a tacit British OK).
I don't know how much this helps, because there is SO MUCH history that flows out of the Boer streak of independence. If you start with the realization that The Netherlands wasn't much involved after 1806, it may be useful. While there were (and are) many cultural and educational exchanges and links, there weren't many political ones. General histories like Nigel Worden's Making of Modern South Africa 5th ed., or Thompson/Berat 4th ed South African: A Modern History might help as well.