I think one should add thet it was PRUSSIA at war with Denmark because the German union / confederation did not yet exist.
>> After the success of Prussia in the six weeks Austro-Prussian War of 1866, Prussia annexed Schleswig-Holstein, Frankfurt, Hesse-Homburg, Nassau and Electoral Hesse, so that all of Germany north of the river Main were either Prussian or allied with Prussia.
Prussia then created the North German League (Norddeutscher Bund), complete with Wilhelm I of Prussia as head of state and a North German Reichstag in Berlin.
<< from http://www.crwflags.com/fotw/flags/de1867.html
The Zollverein, started by Prussia in 1834 gradually moved south to incorporate the smaller states in one customs-free economic union. This customs union was a great boon to industrialization and had far-reaching implication for future political unification<<
>> Bismarkâ€™s steps of unification
War with Denmark 1864 over Schleswig-Holstein.
War with Austria 1866 and the consequent establishment of the north German confederation in 1866. Established the Bundesrat and Reichstag.
War with France 1870-71 to bring the southern states into Germany.
>> (Danish and ) German nationalism could trace its origin to the Romantic movement in the late 18th century against the French export of Enlightenment ideas. Challenging the view that scientific principles were universal, the Romantics in central Europe contended that individuals and individual peoples were unique, bound by a unique soul that was not subject to universal scientific inquiry.
The Napoleonic invasions of central Europe reinforced German nationalism. <<<
Denmark backed the other side and got attacked by the Briitsh consequently
BTW Bismark also introduced national health insurance for the whole population.
>> Bismarck, Prince Otto Edward Leopold von (1815-98),
Prusso-German statesman, who was the architect and first chancellor (1871-90) of the German Empire.
Bismarck was born on April 1, 1815, at SchÃ¶nhausen, northwest of Berlin, the son of a landowning nobleman (Junker) and an upper-middle-class commoner; his multifaceted background accounts for the unique blend of intellectual subtlety and Junker parochialism in his personal makeup. He studied law and in 1836 entered government service. <<
After 1864 many young Danish men migrated to avoid conscription into the Prussian / German army