Germany in the late 18th century was divided into hundreds of states, but then along came Napoleon the Emperor of France who changed them into 39 states.
After creating an army to get Napoleon out of Germany, the most powerful state, Prussia, went to war with Austria. The Austrians saw the German unification as a threat so they took action.
Otto von Bismarck, the Chanceller of Prussia, united many states and wanted to unite more. His goal was to make Berlin the capital of Germany and the strengthen the power of Prussia. Bismarck used tax money to build an army to protect Prussia.
After kicking Austria out of the German Confederation, France, Russia, and Italy joined the battle against Austria. They captured Denmark to taunt Austria, they succeed in doing so and then decimated Austria in battle. After the war, The Treaty of Prague was created, it said that Prussia could keep the land that they won in the war.
Bismarck then turned his attention to France, more explicitly, Napoleon. Even though Napoleon did good in Germany, he also did bad. Napoleon's rule created Liberalism which is the strong believe of equality and liberty. This was bad in Germany because the leaders of Germany was absolute monarchs, this means that the had all the power without and checks and balances. In Germany, liberalists where heavily oppressed and even killed.
Bismarck pubished propaganda against Napoleon then, after his ideas spread, declares war on France. With the anger and increased numbers of Bismarck's soldiers, Napleon was overthrown is deported to Elba and has to pay a 200 million pound fine.