The Boer Wars were caused by the desire of the independent Boer republics to remain free from Great Britain at a time when Great Britain was trying to absorb those republics into its empire.
When gold and diamonds were discovered in the Boer republics (the Boers were of Dutch descent), many foreigners, many of them English, started to move in. The Boers denied them political rights in an attempt to keep control of their countries for themselves. This led to British protests.
British concerns about the treatment of English people in the Boer republics, along with the British desire to take control of those republics, led to the Boer Wars.