Read this article about the precipitating factors of European imperialism toward the rest of the world, including Africa. The export of violence would "come home to roost in 1914".
The British Empire
The best known phrase associated with the
British Empire from the middle of the nineteenth century until the early
twentieth was that "the sun never set" over its dominions. That was,
quite literally, true. Roughly 25% of the surface of the globe was
directly or indirectly controlled by the British in the aftermath of
World War I (1918). Enormous bureaucracies of "natives" worked under
white British officials everywhere from the South Pacific to North
Africa. The ultimate expression of British imperialism was in India,
where just under 100,000 British officials governed a population of some
300,000,000 Indians.
Until 1857, India was governed by the
British East India Company (the EIC), the state-sponsored monopoly
established in the seventeenth century to profit from overseas trade and
which controlled a monopoly on Indian imports and exports. Through a
long, slow creep of territorial expansion and one-sided treaties with
Indian princes, the EIC governed almost all of the Indian subcontinent
by 1840. India produced huge quantities of precious commodities,
including cotton, spices, and narcotics. In fact, the EIC was the single
largest drug cartel in world history, with the explicit approval of the
British government. Most of those narcotics consisted of opium
exported to China.
By the 1830s, 40% of the total value of Indian
exports took the form of opium, which led to the outbreak of the first
major war between a European power, namely Britain, and the Chinese
Empire. In 1840, Chinese officials tried to stop the ongoing shipments
of opium from India and open war broke out between the EIC, supported by
the British navy, and China. A single British gunboat, the Nemesis,
arrived after inconclusive fighting had gone on for five months. In
short order, the Nemesis began an ongoing rout of the Chinese forces.
The Chinese navy and imperial fortresses were nearly helpless before
gunboats with cannons, and steamships were able to penetrate Chinese
rivers and the Chinese Grand Canal, often towing sailing vessels with
full cannon batteries behind them.

A British commemoration of victory in the Opium War. The Nemesis is in the background on the right.
In the end, the Royal Navy forced the Chinese state to re-open their ports to the Indian opium trade, and the British obtained Hong Kong in the bargain as part of the British Empire itself. In the aftermath of the Opium War, other European states secured the legal right to carry on trade in China, administer their own taxes and laws in designated port cities, and support Christian missionary work. The authority of the ruling Chinese dynasty, the Qing, was seriously undermined in the process. (A second Opium War occurred in the late 1850s, with the British joined by the French against China – this war, too, resulted in European victory).
Trouble for the British was brewing in India, however. In 1857, Indian soldiers in the employ of the EIC, known as sepoys, were issued new rifles whose bullet cartridges were, according to rumors that circulated among the sepoys, lubricated with both pig fat and cow fat. Since part of loading the gun was biting the cartridge open, this would entail coming into direct contact with the fat, which was totally forbidden in Islam and Hinduism (note that there is no evidence that the cartridges actually were greased with the fat of either animal – the rumors were enough). Simultaneously, European Christian missionaries were at work trying to convert both Muslims and Hindus to Christianity, sometimes very aggressively. This culminated in an explosion of anti-Christian and anti-British violence that temporarily plunged India into a civil war. The British responded to the uprising, which they dubbed "The Mutiny" by massacring whole villages, while sepoy rebels targeted any and all British they could find, including the families of British officials. Eventually, troops from Britain and loyal Sepoy forces routed the rebels and restored order.

A British depiction of the Sepoy Rebellion, attributing the uprising to greed rather than its actual causes. Note also the use of racial caricatures in depicting the sepoys.
After this Sepoy Rebellion (a term that has long since replaced "The Mutiny" among historians), the East India Company was disbanded by the British parliament and India placed under direct rule from London. India was henceforth referred to as the "British Raj," meaning British Rulership, and Queen Victoria became Empress of India in addition to Queen of Great Britain. She promised her Indian subjects that anyone could take the civil service examinations that entitled men to positions of authority in the Indian government, and elite Indians quickly enrolled their sons in British boarding schools.
The first Indian to pass the exam (in 1863) was
Satyendranath Tagore, but white officials consistently refused to take
orders from an Indian (even if that Indian happened to be more
intelligent and competent than they were). The result was that elite
Indians all too often hit a "glass ceiling" in the Raj, able to rise to
positions of importance but not real leadership. In turn, resentful
elite Indians became the first Indian nationalists, organizing what
later became the Indian independence movement.