Here is an excerpt from the now published Tonio Andrade book, The Gunpowder Age: China, Military Innovation, and the Rise of the West in World History:
Part of the answer of course has to do with industrialization. Steamships destroyed warjunks, towed long trains of traditional vessels into position, reconnoitered shallows and narrows, and, equally importantly, decreased communication times, allowing for minute, systematic coordination of the war effort. Similarly, industrial ironworks made strong, supple metal for muskets and cannons, and steam power was used to bore cannons and mix, crumble, and sort gunpowder.
But industrialization isn’t the only answer. Many of the innovations that most helped the British weren’t about steam power or the division of labor or mechanized factories. They stemmed, rather, from the application of seventeenth- and eighteenth-century experimental science to warfare. During the mid-1700s, new scientific discoveries enabled Europeans to measure the speed of projectiles, understand the effects of wind resistance, model trajectories, make better and more consistent gunpowder, develop deadly airborne missiles, and master the use of explosive shells. These innovations as much as the use of steamship and industrial manufacturing techniques underlay the British edge in the Opium War.
Here is my previous coverage of the book.
For all the talk about recent advances in economics, you don’t hear much about one of the very biggest: how rapidly researchers are filling in the contours of Chinese economic history.