When did the Europeans colonize South Africa?
The Dutch East India Company set up a fort and resupply station in 1652. It became a British colony after the Napoleonic Wars.
The area of Africa South of the Fish River in Namibia has a different climate than the area North and the growing cycles and suitable crops are different. (See"Guns, Germs, and Steel" by Jared Diamond). The area was thus sparsely populated. When the Dutch first settled there they thought the land was empty of people.
Cape Town is located at significant meeting place of ocean currents. The Dutch East India Company would have found it a good harbor on the route from the profitable Dutch East Indies (now Indonesia).
Cape Town from Table Mountain