Military clashes in Schleswig/Slesvig
The secessionist movement of the large German majority in Holstein and southern Schleswig was suppressed in the First Schleswig War (1848–51), but the movement continued throughout the 1850s and 1860s, as Denmark attempted to integrate the Duchy of Schleswig into the Danish kingdom whilst proponents of German unification expressed the wish to include the Danish-ruled duchies of Holstein and Schleswig in a Greater Germany. Holstein was a part of the German Confederation and before 1806 a German fief and completely ethnically German, whereas Schleswig was a Danish fief and was linguistically mixed between German, Danish and North Frisian, which for the German part, was due to immigration over the centuries (prior, before the middle age, the people of Schleswig spoke Danish and Frisian and as late as 18th century many rural areas of southern Schleswig still spoke Danish). In the 19th century the northern and middle parts of Schleswig spoke Danish but the language in the southern half had shifted gradually to German. German culture was dominant among the clergy and nobility; Danish had a lower social status and was spoken mainly by the rural population. For centuries, while the rule of the king was absolute, these conditions had created few tensions. When egalitarian ideas spread and nationalist currents emerged about 1820, identification was mixed between Danish and German.
Furthermore, there was a grievance about tolls charged by Denmark on shipping passing through the Danish Straits between the Baltic Sea and the North Sea. To avoid that expense, Prussia planned to construct the Kiel Canal, which could not be built as Denmark ruled Holstein.
Schleswig, Holstein and Lauenburg before the war
Much of the dispute focused on the heir of King Frederick VII of Denmark. The Germans of Holstein and Schleswig supported the House of Augustenburg, a cadet branch of the Danish royal family but the average Dane considered them too German and preferred the rival Glücksburg branch with Prince Christian of Glücksburg as the new sovereign. Prince Christian had served on the Danish side in the First Schleswig War (1848–1851). At the time, the king of Denmark was also duke of the duchies of Holstein and Schleswig. In 1848, Denmark had received its first free constitution and at the same time (and partly as a consequence) had fought a civil war with the Germans of Schleswig-Holstein, in which Prussia had intervened.
The peace treaty stipulated that the duchy of Schleswig should be treated the same as the duchy of Holstein in its relations with the Kingdom of Denmark. During the revisions of the 1848 constitution in the late 1850s and early 1860s, Holstein refused to acknowledge the revision, creating a crisis in which the parliament in Copenhagen ratified the revision but Holstein did not. That was a clear breach of the 1851 peace treaty and gave Prussia and the German union a casus belli against Denmark. The German situation was considerably more favorable than it had been fifteen years before, when Prussia had to give in due to the risk of military intervention by Britain, France and Russia on behalf of Denmark. France had colonial problems, not least with Britain. Otto von Bismarck had neutralized Russia politically and succeeded in obtaining cooperation from Austria which underlined its great power status within the German union.
To understand the Danish resolve in this question one must also understand that the Danes regarded Schleswig as an ancient core region of Denmark. The southern part of Schleswig contains the ruins of the old Danish viking "capital" Hedeby and the fortification "Danevirke" (first sections built by the Danes around 300-500 AD, possibly to protect Denmark from either Rome or migrating tribes during the age of migration). Before the Danes took possession of the area, around 300 AD, Schleswig was the home of the Angles, of which many migrated to Britain where they would later form the Anglo-saxon kingdoms, the remaining Angles are believed to have assimilated with the Danes, indeed the Angles and the Danes seem to have had a very close relationship as attested by the shared sagas of the early English and Danes. Thus, to suggest that the region did not fully belong to Denmark was seen as a great provocation to the Danes' ancestral claim to Schleswig.