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.
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 Schleswig War 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.