stylistic:tone
British colonisation and the Great Trek

Great Britain occupied Cape Town between 1795 and 1803 to prevent it from falling under the control of the French First Republic, which had invaded the Low Countries. After briefly returning to Dutch rule under the Batavian Republic in 1803, the cape was occupied again by the British in 1806. Following the end of the Napoleonic Wars, it was formally ceded to Great Britain and became an integral part of the British Empire. British emigration to South Africa began around 1818, subsequently culminating in the arrival of the 1820 Settlers. The new colonists were induced to settle for a variety of reasons, namely to increase the size of the European workforce and to bolster frontier regions against Xhosa incursions.

In the first two decades of the 19th century, the Zulu people grew in power and expanded their territory under their leader, Shaka. Shaka's warfare indirectly led to the Mfecane ('crushing'), in which one to two million people were killed and the inland plateau was devastated and depopulated in the early 1820s. An offshoot of the Zulu, the Matabele people created a larger empire that included large parts of the highveld under their king Mzilikazi.

During the early 19th century, many Dutch settlers departed from the Cape Colony, where they had been subjected to British control, in a series of migrant groups who came to be known as Voortrekkers, meaning "pathfinders" or "pioneers". They migrated to the future Natal, Free State, and Transvaal regions. The Boers founded the Boer republics: the South African Republic, the Natalia Republic, and the Orange Free State.

The discovery of diamonds in 1867 and gold in 1884 in the interior started the Mineral Revolution and increased economic growth and immigration. This intensified British subjugation of the indigenous people. The struggle to control these important economic resources was a factor in relations between Europeans and the indigenous population and also between the Boers and the British.

On 16 May 1876, President Thomas François Burgers of the South African Republic declared war against the Pedi people. King Sekhukhune managed to defeat the army on 1 August 1876. Another attack by the Lydenburg Volunteer Corps was also repulsed. On 16 February 1877, the two parties signed a peace treaty at Botshabelo. The Boers' inability to subdue the Pedi led to the departure of Burgers in favour of Paul Kruger and the British annexation of the South African Republic. In 1878 and 1879 three British attacks were successfully repelled until Garnet Wolseley defeated Sekhukhune in November 1879 with an army of 2,000 British soldiers, Boers and 10,000 Swazis.

The Anglo-Zulu War was fought in 1879 between the British and the Zulu Kingdom. Following Lord Carnarvon 's successful introduction of federation in Canada, it was thought that similar political effort, coupled with military campaigns, might succeed with the African kingdoms, tribal areas and Boer republics in South Africa. In 1874, Henry Bartle Frere was sent to South Africa as the British High Commissioner to bring such plans into being. Among the obstacles were the presence of the independent states of the Boers, and the Zululand army. The Zulu nation defeated the British at the Battle of Isandlwana. Eventually Zululand lost the war, resulting in the termination of the Zulu nation's independence.