Military history of South Africa during World War I
South Africa's participation in the First World War occurred automatically when the British Government declared war on Germany in August 1914. Due to her status as a Dominion within the British Empire, South Africa, whilst having significant levels of self-autonomy, did not have the legal power to exercise an independent foreign policy and was tied to the British declaration.
Source: Wikipedia — Military history of South Africa during World War I (CC BY-SA 4.0)