After 1850, the states of Germany had rapidly become industrialized, with particular strengths in coal, iron (and later steel), chemicals, and railways. In 1871, Germany had a population of 41 million people; by 1913, this had increased to 68 million. A heavily rural collection of states in 1815, the now united Germany became predominantly urban. During its 47 years of existence, the German Empire was an industrial, technological, and scientific giant, gaining more Nobel Prizes in science than any other country. By 1900, Germany was the largest economy in Europe, surpassing the United Kingdom, as well as the second-largest in the world, behind only the United States.
The high command under Paul von Hindenburg and Erich Ludendorff increasingly controlled the country, as they gambled on one last offensive in spring 1918 before the Americans could arrive in force, using large numbers of troops, aeroplanes, and artillery withdrawn from the Eastern Front. This offensive failed, and by October, the German armies were in retreat, Austria-Hungary and the Ottoman Empire had collapsed, Bulgaria had surrendered, and the German people had lost faith in their political system. After at first attempting to retain control, causing massive uprisings, the Empire collapsed in the November 1918 Revolution with the abdications of the Emperor and all other ruling monarchs. This left a postwar federal republic that generated a devastated and unsatisfied populace, which later led to the rise of Adolf Hitler and Nazism.
German nationalism rapidly shifted from its liberal and democratic character in 1848, called Pan-Germanism, to Prussian prime minister Otto von Bismarck's pragmatic Realpolitik. Bismarck sought to extend Hohenzollern hegemony throughout the German states; to do so meant unification of the German states and the exclusion of Prussia's main German rival, Austria, from the subsequent German Empire. He envisioned a conservative, Prussian-dominated Germany. Three wars led to military successes and helped to persuade German people to do this: the Second War of Schleswig against Denmark in 1864, the Austro-Prussian War in 1866, and the Franco-Prussian War against France in 1870–71.
The German Confederation ended as a result of the Austro-Prussian War of 1866 between the constituent Confederation entities of the Austrian Empire and its allies on one side and the Kingdom of Prussia and its allies on the other. The war resulted in the partial replacement of the Confederation in 1867 by a North German Confederation, comprising the 22 states north of the Main. The patriotic fervour generated by the Franco-Prussian War overwhelmed the remaining opposition to a unified Germany (aside from Austria) in the four states south of the Main and during November 1870 they joined the North German Confederation by treaty.