The Second Boer War began on October 11, 1899, when the two Boer republics, the Transvaal and the Orange Free State, attacked British territory in Natal and the Cape rather than accept the ultimatum London had sent about the gold fields. The republics had mobilised. Britain was said to be facing a fight it would win by Christmas. It ran two and a half years, cost more than 20,000 British dead, and ended with the republics taken into what became the Union of South Africa.
The quarrel was about gold and about who was the majority. The Witwatersrand reefs, found in 1886, made the Transvaal the richest patch of ground in the world and brought in a flood of uitlanders, foreign miners and speculators, who soon outnumbered the Boer farmers but were denied the vote. The empire's position was that these were British subjects being denied their rights; the Transvaal's position was that a state financed by its own gold was not going to hand itself to the men who had come to dig it. Joseph Chamberlain in London and Alfred Milner at the Cape pushed, and the Jameson Raid of 1895 had already shown the republics what British South Africa was capable of.
The first phase went badly. The Boers, farmers who fought as mounted riflemen on horses they had ridden all their lives, won at Colenso, Stormberg and Magersfontein in December 1899 in what was called Black Week, and besieged Ladysmith, Mafeking and Kimberley. Reinforcements under Roberts and Kitchener lifted the sieges and took Pretoria by June 1900, and the war was declared won.
It went on. The remaining commandos fought a guerrilla war from the veld for another two years, and Kitchener answered by burning farms and putting their women and children into camps, where around 26,000 Boers and roughly 20,000 black Africans died, most of them children, of disease and neglect. The Treaty of Vereeniging ended it in May 1902. The two republics lost their independence. The peace that followed set up the framework, British and white, inside which South Africa was run for the next ninety years.