If so, how much did empire contribute to British prosperity?
Part 1, because Reddit
To ask whether Britain is rich today because of their empire would be to linger into the question of whether they wouldn't be rich if it wasn't for their colonial history. This is bordering into alternative history (ie, would they have been rich without it?) and since I don't want to dive into that topic all too much I'll simply stick to where British wealth came from.
I'll be drawing heavily from Robert B Marks book; The origins of the modern world.
It is often said that the cradle of the industrial revolution is in Britain, England more specifically, and it is easy to see where that point of view comes from. By the mid 19th and early 20th centuries, Britain was top, front and center when it came to industrial capacity and production. How did this come to be?
The wealth and production of India and China
Prior to the age of aggressive colonial expansion, it is important to keep in mind that Europe was, by all ways of measuring it, the economical backwater of the 'known world' (ie, Europe, India, China, the Middle East, South-east Asia), which had been more or less indirectly connected through trade all the way back to the days of Rome. While digging deep and comprehensively into the exact economic situations of India and China compared to Europe is something that would require a whole book to go through, I can list an interesting piece of statistics just to help the reader get a quick idea:
Around the year 1800 India (not a united nation, mind you, but the states making up what is today India) and China produced roughly half (!) of the worlds GDP. Compare this to the year 1900, when 90% of the industrial capacity of the world comes from Europe, the US and Japan alone.
Prior to this dramatic shift, the European economy was strongly dependent on trade with these incredibly rich regions (one must not forget that the reason Colombus went west wasn't to find a 'new world' and colonize it, but to find a new trade route to the aforementioned wealth). The same goes for the Portuguese travels around the south end of Africa.
A number of goods were traded, originally China was mainly interested in silver (without divulging too much into that specific story, China had a high demand for silver due to its shift from paper money to coins in the early period of the Ming dynasty). This silver trade is what kept the Spanish Empire alive, as without it many historians argue that Spain would have collapsed in on itself under debt. I would personally argue that China's hunger for silver is probably the one single thing that has influenced not just economic history, but world history, the most. Not just Europe would've been a radically different place, but the rest of the world (out of which it colonized/conquered some 80% at its peak) would've been different too.
If we jump forward from the Spanish silver mines to the age when Britain starts to really race ahead of its European competitors, we need to move to the seven years war (1756–1763, where they secure India as their interest sphere alone, by more or less ousting the French from the region).
India, while politically fractured, was an economic powerhouse at the time, in particular when it comes to cotton and food produce. Both China and India had an incredibly high return yield of food produce, the key element of any pre-industrial economy for obvious reasons. With that said, India might end up being the crown jewel of the British empire, but it was still trade with China that was the ultimate goal. China had a history of setting up a quite restrictive trade with foreigners and in the year of 1760 the Chinese decided to limit all trade, in particular with the British (who were desperate for tea, importing roughly two million kilos a year, but also satin and porcelain, or China as it is still called today). The British were limited to a single port in Guangzhou in southern China where the British were allowed to trade, but only by the good will of the Chinese rulers.
Every now and then the British tried to negotiate their way around their limitations. One of the most famous of these negotiations happened in 1793, when sir George Macartney went to China to establish more formal diplomatic relations in between their nations and open up for an easier access to the Chinese markets. After being shown the imperial splendor in Beijing he was then sent away. The Emperor Qianlong wrote a letter to the British King George the III and rejected the offer of increased trade, stating that that (roughly translated) 'Our Heavenly kingdom already possesses an abundance of all it needs and lacks for no goods within its borders'. He also ordered the British to follow the Chinese laws and respect the customs of his people.
His assessement of the economy isn't true, but his, to our modern eyes, quite cocky reply wasn't unfounded either. Despite the fact that the industrial revolution was well on its way, China was still way too big of a cookie for the British to force their way to. Unlike India, which was politically fractured and vulnerable to divide and conquer tactics, China couldn't be pushed around yet.
And so Britain struggled with their trade relations, including finding what wares to sell. British tea-consumption was on the rise (ten percent of the average factory worker's wages went to tea and sugar) and consumption of tea rose from 2 million kilos of tea in 1760 to 10 million kilos in the year 1800. Note that the 10 million kilos a year consumption comes from official records, it is believed that including tea smuggling, the number would roughly double. The British couldn't control the flow of silver as easily as they had before, and the Chinese were not interested in Indian cotton (they producted plenty themselves) nor in British wool. There was however one completely different type of goods that could be easily produced in India and sold on the Chinese markets...
Opium
By the year of 1773 the British governor of Bengal had established a monopoly on the production and trade of opium and was tasked with a mission to increase said production and attempt trade with China. Despite the Chinese government trying to banish its consumption the British saw success in selling it, in particular when they did the ingenius move to hand out free pipes and sell at very low rates to first-time consumers (a trick employed to this day by many drug dealers). It would take some time by consumption skyrocketed by 1815 after a price drop and further still in 1830 when the British started growing Opium in more regions of India and further still in 1834 when the East India Company lost its monopoly on the trade.
Addiction became widespread, with around 100 000 users only in the city of Suzhou. The tide of silver had turned, and now silver was for the first time in a long time traded out of China, in return for Opium. The Chinese governmented quarrelled over how to deal with it (some argued ban it, others argued to legalize and let the state control distribution). The former group won the debate, and the emperor sent Lin Zexu as his special envoy to investigate the matter and end the sale.
After visiting Guangzhou Lin wrote a letter to queen Victoria and asked her control her countrymen who had lost all morals (the letter never reached the queen). After locking foreigners up and refusing to let them go unless they surrendered their stashes, he finally got his hands on some 21 000 caskets (roughly weighing 70 kilos each) worth of opium and poured them all into the river.
That would, sadly for the Chinese, not be the end of the story. After many minor clashes and political agitation in England (in particular from the textile factories in Manchester, who wanted opened markets in China for their goods), the first opium war (1839 to 1842) started.
As a sidenote, the ship Nemesis saw action in this war, the first british gunboat built without any wood in its design. The relatively small ship was excellent for manouvering Chinese rivers and packed a punch that the rivaling Chinese navy couldn't handle. The war was navally a complete dominance for the British and the Chinese were forced to sign the peace treaty (although it wouldn't mean peace in China for very long, as the name the first opium war implies). As a curious side note, about two thirds of the british troops employed in the war were in fact Indian-born.
Ironically, the first Opium war did not see Opium legalized in China, rather that happened in the second opium war (1858-1860), but the groundwork was laid. Territorial concessions and political leverage on the Chinese government.
For some more numbers, around 95% of all Opium in the world was consumed in China and there were opium dens in more or less every major city in the nation. The money made from the drug trade built the spine of the super power to be and a french historian, Lois Dermigny, put it very neatly when he said that 'it was as if the British subdued India solely to use its resources to subdue China'.
This is however not fully true: as populations grew globally many governments faced the same issue: how to deal with having more and more mouths to feed. The US famously built such a strong agricultural industry that even to this day they are one of the leading producers of food, but England isn't blessed with as much soil nor as fertile. 'Luckily' Britain could import food from its many colonies in order to sustain their ever growing population.