Wars were somewhat important, but they were not the main cause of expansion and contraction of the British Empire in Africa during these years.
It is true that the British Empire expanded to some extent through war. Perhaps the best example of this is the Boer War. It is also true that World War II helped to reduce the size of the British Empire in Africa (at least eventually).
However, war was not the main driving force behind expansion or contraction. Most African countries/regions were not strong enough to seriously resist the English as they colonized. The decolonization of Africa happened, for the most part, peacefully. The British Empire in Africa was not (for the most part) taken by war and it was not lost by wars either. Therefore, wars were not hugely important in this process.