The Danish-Prussian War was fought between Denmark and the "German Confederation."
The German Confederation was a construct that Austria put in place to not precisely rule in Germany but to make sure its voice was the most important. Kind of like if the US created an Organization of American States AND then dominated it, crushing opposition to its wishes via economic spankings and outright military force. Austria wished to control Germany, but could not conquer the various nations it was made of so they did the confederation.
Denmark had obligations to the confederation in regard to a couple of its regions. Why? Why indeed? Well, because most of the people in those regions were German in heritage, the bully, Austria, directed the confederation (which being Germans all was more than happy to help) to force Denmark into this. There had already been one war on the matter and when Denmark thumbed its nose at the confederation, Austria directed it to go to war.
In the confederation, the most important non-Austrian nation was Prussia. Prussia also shared a border with the regions, wanted to control them itself directly, and had no willingness whatsoever for Austrian armies to enter its borders. So the war in Denmark was fought largely by the Prussians. That's why it was called the Danish-Prussian War when technically, it was all of Germany AND all of the Austria-Hungarian Empire that was chewing the Danes up.
After that war, Austria realized it had let Prussia get far too strong over the centuries. Not only that, but it saw that, though they had little in common with strict Prussian thinking (Osama Bin Laden takes Islam far too lightly compared to the conservative nature of Prussian thinking!), the other German nations were completely fed up with Austrian domination. Too late they realized the Prussians had performed against the Danes solely for their own ends.
Prussia had a concept for these years and moved on to the "Austria must go as boss" stage. They went to war with Austria and in no time at all, their very modern army cut the Austrians to pieces and forced a humiliating peace. "Very modern" doesn't mean simply new cannons and so on. It means they used much of the industrial base of the modern European country while Austria kludged along much like Napoleon might have. The Prussians, for example, used their rail system for collecting soldiers, moving them to the right staging points, and attacking. They used the Austrian rail system equally well. The Austrians were largely marching (walking) to the points of attack. The Prussians could attack in one place, then load up the trains and the same army attack a couple days later 150 miles away. This gave their army the fighting power of a hugely larger force. The Austrian would concentrate in one place only to find the right place was now a hundred miles away. More though, the Prussians, for example, when mobilizing their army in the first place, used their modern post office system to notify which men to show up where and what trains to take to do it. The Austrians had massive cluster-f... um, massive back-ups in getting their armies put together.
With these two victories in hand, the Prussians organized the German Empire, a collection of the nations and smaller entities in Germany, installed their king as Emperor, and faced out to the world, in full dominance of central Europe, and as the voice of all Germans.
France, at the time, was in the control of Napoleon III. He had many problems, including the failure of a modern European nation to force its will upon such a backward place as Mexico. That spectacular failure and the recent British successes in African colonization humiliated the French pride. Napoleon's government was never incredibly strong and amongst other reasons for war, he felt a nice victory against the upstart Prussians (and Germany) would restore his strength in France, and put all Europe on notice that France was fully back (For centuries, every nation of Europe tried to combine to resist France's domination and conquests. But not since Napoleon I's crushing defeats...).
Prussia set upon France like a plague. They crushed French armies and drove deep into France. After a siege, even Paris fell. Napoleon fell, and Prussia (Germany) reigned supreme. In a fairly foolish move, though supported by history and reminiscent of what they'd done recently to Denmark, Prussia took a couple regions of France as part of the victor's spoils.
Why was that foolish? Over the 60 years from Napoleon to Napoleon, France and Britain had gradually become "not-enemies" and would over the next 20 years become allies. Why could that happen? Because there was no issue that could not be addressed between them. If Britain had taken any portion of France after Napoleon's defeat at Waterloo and ruled it, France could never have gotten past that. Start suggesting France and Britain get along better? French folk would have shouted down the blas