Why was the Qing Dynasty able to quell the Taiping Rebellion yet it fell to the Xinhai Revolution?
I would cite several reasons.
First, much had happened between the quelling of the Taiping (1863) and the Xinhai Revolution (1911). Suppressing the Taiping was itself a near-death experience for the dynasty, and weakened the Qing substantially. Indeed, well before the Taiping Heavenly Kingdom was finally snuffed out, the Qing was embroiled in the Second Opium War (the Arrow War), which culminated in the march of an Anglo-French allied army marching into Beijing, sending the court into flight, and sacking — really, completely destroying — the Old Summer Palace, the Yuanmingyuan.
The Taiping Rebellion wasn’t the only domestic uprising happening in the 1850s, either: There was also the massive Nian Rebellion, which erupted from the impoverished border regions of northern Jiangsu and Anhui, southern Shandong, and eastern Henan in 1851 and lasted actually until 1868. For various reasons — no weird quasi-Christian backstory, no “white savior” Americans like Frederick Townsend Ward or Brits like Charles Gordon, not quite the body count — it isn’t as well-known as the Taiping Rebellion, but combined to fundamentally shake the foundations of the dynasty.
The threats from abroad, costly in blood, treasure, territory, and imperial prestige, continued unabated. China fought a war with France in 1884–85, which cost the Qing control over the northern part of Vietnam and ceded an effective French sphere of influence in much of southwest China. Most disastrously, a decade later China lost a war to Japan, which destroyed the vaunted new Chinese fleet and forced the Qing court to sign the humiliating Treaty of Shimonoseki, which imposed a 7.5-million-kilogram silver punitive indemnity on the Qing, forced the dynasty to cede the Pescadores island chain and Taiwan to Japan, and gave Japan control over part of the strategic Liaodong Peninsula (the city of Dalian and environs).
A coup d’etat led by the Empress Dowager Cixi put an end to a bold reform initiative in 1898 — the Hundred Days Reforms, which were the brainchild of the Confucian scholar and reformer Kāng Yǒuwéi 康有为 and his equally brilliant amanuensis Liáng Qǐchāo 梁启超, sending both into exile after a narrow escape from the authorities that would have seen them share the fate of another prominent colleague, Tán Sìtóng 谭嗣同, who was arrested and executed.
And then there was the folly of the Qing’s support for the Yìhétuán 义和团 — the Boxers, a nativist, xenophobic rebel group that started off hostile to the Manchus but were co-opted, their destructive energies turned against foreigners. In 1900 they marched on Beijing and laid siege to the Legation Quarter, eventually prompting several imperialist nations to create the Eight-Nation Army (八国联军 bāguó liánjūn), composed of troops from Austria-Hungary, Britain, France, Germany, Italy, Japan, and the United States. This alliance was infamous in China for sacking not only (what was left of) the Old Summer Palace, but also for looting the Forbidden City itself. They defeated the Boxers and forced the Qing into another ignominious flight from the capital, and forcing them into a humiliating schedule of massive indemnities.
Most importantly, the suppression of the Boxers had resulted basically in the destruction of all the Manchu Banners, the hereditary military units that were the bulk of the Qing military. The main force that remained was the New Army, which had been organized after the defeat by Japan in 1895. Its commander was Yuán Shìkǎi 袁世凯, a talented and ambitious general. He was the dominant military commander in the area near the capital — and most of his troops were Han, not Manchu. Yuan built a powerful network of military leaders who owed him personal loyalty. Rightly recognizing him as a threat, he was removed from power and sent into retirement (narrowly escaping death) in 1909.
Meanwhile, the Qing did undertake fairly sweeping reforms beginning after 1901. But these seem (by some historical “law” that Alexis de Tocqueville seems to have recognized in L’Ancien Regime) only to have given revolutionary movements oxygen and fodder, emboldening many and tipping more moderate Chinese from the reform camp (constitutional monarchy, mainly) into revolutionary republicanism.
In the decade or so before the Xinhai Revolution, there were numerous anti-Manchu revolutionary societies established, mainly abroad and most importantly in Japan. Increasingly, these took on strong nationalist or nativist ideological coloring: They blamed the Manchus, who were, as they emphatically reminded anyone who would listen, not Chinese but an alien, conquering class that had gone decadent but had lost none of their cruelty and had become criminally incompetent. The ethnically charged atmosphere of the early 20th century stood in stark contrast to the mid-19th century, when Han Chinese scholar intellectuals — those opposing the Taiping, anyway — rallied to the Qing and insisted on their legitimacy as a Chinese dynasty.
The Tongmenghui, or Alliance Society, was foremost among these anti-Manchu revolutionary societies and is usually credited as the instigator and ideological inspiration for the Revolution. It may not have a direct hand in the events sparking the Wuchang Uprising of October 10, 1911 — the event that sparked the Xinhai Revolution — but the Tongmenghui and its leader, Sun Yat-sen (孫中山 Sūn Zhōngshān), were involved in many of the other uprisings that followed. The Wuchang Uprising (which happened while Sun was actually in the U.S.) was basically a mutiny of troops in the middle Yangzi city of Wuchang. This was actually just the latest in a long series of similar mutinies or uprisings by soldiers, but this time the main difference was that the real power broker of the age, Yuan Shikai — who had been called out of retirement and put back in charge of his troops — decided first to flatten Wuchang completely, and then (his power amply demonstrated to the rebels) to negotiate with them. They struck a deal whereby Yuan would secure the abdication of the last Qing emperor and would be given the “provisional” presidency of the new republic to be established at the dynasty’s end.
So the real proximate reason for the revolution’s success was Yuan’s decision to throw in with them and secure the abdication. But the other factors are very important to keep in mind: The military exhaustion of the dynasty following internal rebellions and external invasion, the anti-Manchu ideology that informed so many of the revolutionary movements and its implications for the defection of Confucian literati elites, the ethnic composition of the troops who formed the most powerful army, and the perceived loss of legitimacy of the Qing.