There is so much to this topic it is taking longer than I originally thought. Also, the subject of German Unification is a topic that could, in itself, take mane pages to write about. This post will be just a basic survey of the subject as it is relevant to the topic of the survival of monarchies.
After the failure of the 1849 Frankfurt Parliament to unify Germany the desire for a unified country still existed. The problem was dualism. During this time of the German Confederation we had a Germany with two heads: Austria and Prussia. For Prussians many felt Austria had to go its own way. The man who felt most strongly about that was Prussian Chancellor Otto von Bismark. Not a supporter of Liberalism at all Bismark believed that Germany needed to be forged out of blood-and-iron and under the leadership of Prussia.
In 1861 King Wilhelm I became King of Prussia and shortly thereafter he appointed Otto von Bismarck as the Chancellor. To unify Germany Bismark developed a plan that would exclude Austria, and then join the southern German States with Prussia and the other northern German States. Bismark knew that these steps would only be accomplished through a series of wars. In 1864 a crisis in Denmark provided the first step. There was a great controversy over the ownership of the thrones of the united Duchies of Schleswig and Holstein. Both Denmark and Prussia had claims. In 1863 the king of Denmark, Christian IX, annexed these territories which violated the London Protocol of 1853.
Under Bismark’s plan the Austrian Empire was deliberately drawn into this war by Otto von Bismarck, Chancellor of Prussia. The Austro-Prussian war was short and an easy Prussian victory led to Schleswig, the northern part, being governed by Prussia and Holstein, the southern part, being governed by Austria. (Treaty of Vienna (1864). The next step in German unification for Bismark was to remove Austria from German interests and to do this he goaded them into war. This opportunity came in 1866 when Bismarck accused the Austrian Empire of stirring up troubles in Prussia-held Schleswig. Austria declared war on Prussia and Prussian troops drove into Austrian-held Holstein and took control of the entire state of Schleswig-Holstein. The short seven weeks war found Austria swiftly defeated. The resulting Treaty of Prague (1866) formally dissolved the German Confederation and Prussia created the North German Confederation to include all Germanic states except the pro-French, southern kingdoms of Bavaria, Baden and Württemberg which formally created the Southern German Confederation.
Bismark’s next step was to bring the Southern German Confederation into union with the Prussian lead North German Confederation. The next step was complex so I will simplify it. In 1868 Queen Isabel II of Spain was deposed and the Spanish Parliament voted Prince Leopold of Hohenzollern-Sigmaringen as their king. The French who were ruled by Napoleon III did not want to be sandwiched in by two Hohenzollern empires. After a series of rejections of the candidacy of Leopold for the Spanish throne the matter seemed settled. It wasn’t. In 1870 Napoleon III, demanded territories of the Rhineland in return for his neutrality during the Austro-Prussian War. This increased tensions between France and Prussia. Bismarck used the Spanish Succession question and the Ems Telegram to King Wilhelm to start a war. The Ems Telegram was a harmless telegram from the French ambassador to King Wilhelm looking for reassurance that the candidacy of Prince Leopold was dropped. Bismark reworded the Ems telegram to give the French the impression that King Wilhelm I had insulted Count Benedetti; likewise, the Germans interpreted the modified dispatch as the Count insulting the King. As a result Napoleon III declared war against Prussia.
The Franco-Prussian War 1870-71 was also swift and ended with Prussian troops capturing Paris, the capital of the Second French Empire. Bavaria, Baden, and Württemberg were incorporated into the North German Confederation in the Treaty of Frankfurt (1871). Bismarck then proclaimed King Wilhelm I, now Kaiser Wilhelm I, as leader of the new, united Germany (German Reich). With the German troops remaining in Paris, Napoleon III dissolved the French Empire and a new republic, Third French Republic, was created under Adolphe Thiers. The Prussian Constitution became the Constitution for the German Empire and gave both the Chancellor and the Emperor considerable power.