The Cape Province had had a qualified franchise from the introduction of responsible government in 1853, based a fairly low property threshold for men regardless or race (similar to the UK at the time) to which a literacy test was later added.
Natal had a franchise which was in theory non-discriminatory but in practice was white men only, and not all of them. The Transvaal (South African Republic) and Orange Free State had an explicit colour restriction and up to the Second Boer War also excluded uitlanders (foreigners, i.e. English speakers) from the franchise; this last restriction in the Transvaal contributed to the start of the war after the arrival of a large number of gold miners. So discrimination was a cause of the war, but it was language discrimination rather than race.
After British victory in 1902, the London government wanted to see a single South Africa, and this was implemented though the South Africa Act 1909. Each province of the Union regarded preserving its own franchise provision as critical, while the London government wanted to see union more than democracy (a universal male franchise did not arrive in the UK until 1918), so the existing provisions continued in each province.
The British Government did little to interfere in South African politics after the First World War, treating it in a similar way to Canada, Australia and New Zealand.
The South Africa Act entrenched the Cape franchise, though when South Africa moved to a universal white franchise in 1931 this was not extended to Coloureds or Blacks in the Cape, for whom voting remained qualified and male only. It was finally removed in 1956 by major expansions to the Senate and Appellate Court to ensure that the constitution could be changed despite the entrenchment.
The United Party was not the platform of English-speaking white South Africans in the 1930s and 1940s, even if most of them voted for it. It was created in 1934 by the merger of the National Party and the South Africa Party, both led by Afrikaner politicians who had fought against the British in the Boer War, as a protective measure against the forces of Communism and Fascism, both of which they believed threatened the stability of the country during the Great Depression. It split again at the start of World War II, between those willing to fight Germany and who were not; the former group (still calling itself the United Party) won the 1943 elections, but the latter group (the Reunited Nationalist Party) won most seats in the 1948 elections with their apartheid manifesto despite the United Party winning the most votes.
The London government did not at any stage try to impose its will on any of this, though it did express its opinion, most famously in Harold Macmillan's 1960 "Winds of Change" speech to the South African parliament.
The more enlightened views in the London government had a greater impact in the delays to independence in (Southern) Rhodesia, with London adopting a policy of "no independence before majority rule", leading to the white Rhodesians making a unilateral declaration of independence in 1965, which in turn led to British-led sanctions, with the position finally being settled with the creation of Zimbabwe in 1980.