he histories, identities and borders of most continental countries have usually been shaped by war. This is especially true of Germany, whose national consciousness sprang from the humiliations inflicted by Napoleon. Germany became a sovereign reality only in 1870 with the defeat of France and the proclamation of the German empire – the Second Reich – in the Hall of Mirrors at Versailles.

In the preceding centuries under the First Reich of the Holy Roman empire, the patchwork of princely states and bishoprics had little more than the German language as a common bond. As Neil MacGregor, our greatest cultural polymath, demonstrates in this excellent book to accompany the exhibition at the British Museum and the BBC Radio 4 series, “Germany” could be defined only by where German was spoken. And even then there was “high German” in the south and “low German” in the north, with a host of dialects ranging from the Volga Germans in Russia to the Saxons in Transylvania.

The great unifier was Martin Luther, whose translation of the Bible brought the language together and spread it thanks to Gutenberg’s printing presses. But Luther also proved to be the great religious divider in the schism that led to the 30 years war, a conflict as horrific in its time as the second world war. In 1945, as the Red Army rampaged into German territory, the terrified population sought comfort in singing Luther’s hymn A Mighty Fortress Is Our God.

Literacy spread through the bureaucracies of the German statelets and craftsmanship flourished under the guild system. Craftsmen seized the opportunities that came from being at the centre of trade routes, and the most skilled profited as princes tried to impress one another by vying to offer the most original diplomatic gifts. High-class production thrived. In Mainz, there was Gutenberg; in Nuremberg, Albrecht Dürer, the inventor of the logo with his initials, mass-produced art through prints; Meissen porcelain, like other inventions borrowed from the Chinese, was developed by Augustus of Saxony near Dresden; and clockmaking, scientific instruments and work in precious and other metals achieved new heights in other cities. After the Napoleonic wars, commercial competition forced the end of the guilds, yet the German reputation for rigorous quality and inventiveness endured. On a more ominous note, the advance in precision engineering also improved German armaments.

Wars against France, the dominant power in Europe, had left their mark. Louis XIV’s seizure of Strassburg, making it the French city of Strasbourg, was never forgotten. The city was re-Germanised twice more, after the Franco-Prussian war and in 1940. But it was Napoleon’s subjugation of German states in 1806 that triggered a sense of nationalism. Königsberg, the birthplace of the Prussian state, was also the site of its rebirth in the struggle against Napoleon. The “Iron Kingdom” had been partially militarised under Frederick the Great and his father, but a far more intense process took place in the decades following Napoleon’s invasion.

The new nationalism in the wake of Napoleon encouraged Germans to look back to a mythical and semi-mythical past: to Nibelungen as well as to Hermann’s victory in the Teutoburg Forest over the Roman legions in AD9. A vast statue of Hermann facing towards France was built there after the Napoleonic wars and finally completed in 1875.

The forests of Germany, meanwhile, took on a special significance, whether the dark stories of the Brothers Grimm, the spiritual loneliness of Caspar David Friedrich’s paintings or the emotional relationship with nature of the Wandervögel movement. A symbolic importance was invested in the eternal oak, with its leaf used on coins and medals. The higher version of Hitler’s Knight’s Cross of the Iron Cross was decorated with oak leaves – the Eichenlaub.

This fear and love of forests, encompassing both good and evil, almost certainly linked to the Sturm und Drang movement of early Romanticism, suggests a paradoxical influence in the German consciousness. Goethe’s dark works, The Sorrows of Young Werther and Faust, exist alongside a meridional love of light and lemon blossom in Italy. Whether that great German flaw, the confusion of cause and effect that produced the stab-in-the-back legend after the first world war, is another aspect of that split personality is hard to say. But while embittered Freikorps set out to crush the revolutions of 1918 and 1919, the German National Assembly chose Weimar, the city of Goethe and Schiller, as the symbolic beginning of their ill-fated republic.

Anyone who wants to understand Germany should read this book, yet along with every observer of its past, MacGregor remains baffled by the juxtaposition of humanism and authoritarianism. The concentration camp of Buchenwald lay in the woods outside Weimar where Goethe used to walk. How could the great humanistic traditions of Germany have become perverted into unimaginable cruelty? Our fascination with the question will probably never end, mainly because the second world war presented more moral choices than any other period in history, especially to all those Germans who were not Nazis. “What would we have done?” MacGregor rightly demands of those who were not there.

The suffering caused by the demented ambitions of the Nazi regime is still beyond the comprehension of normal human beings. And the tragedy for Germans in the east in 1945 was also immense, with 12 to 14 million refugees dispossessed, many admittedly from land and houses seized from Poles and others. In farm wagons and pulling handcarts through the snow, they risked being crushed under the tracks of Red Army tanks. During this flight to the west and the subsequent ethnic cleansing, between half a million and two million people died, mainly women and children. Königsberg, the birthplace of Immanuel Kant and Käthe Kollwitz, was annihilated and became the Soviet city of Kaliningrad. Breslau, or what remained of it, became Polish.

The summer of 1945 was Stunde Null – zero hour – when Germany was reduced to nothing, its cities smashed by allied bombing. With their menfolk in prison camps or traumatised by defeat, the country was saved by its women, working as Trümmerfrauen, or “rubble women”, clearing the debris and piling the bricks ready to build anew. Along with the refugees, Germans gritted their teeth and worked. The economic miracle – the Wirtschaftswunder – led Germany to become the great export car maker of the time. The rigorous metal craftsmanship of old developed into the Vorsprung durch Technik of the modern age.

At the same time came a great break with the past. In January 1979, the American miniseries Holocaust was broadcast in the Federal Republic. The younger generation began to question their parents about the war. The period of denial was over. And following the fall of the Berlin Wall and reunification, the Reichstag was redesigned, incorporating a glass viewing platform for the people to look down and watch their leaders, in stark contrast to the way they had been watched by the Gestapo and the Stasi. With the symbol of the rebuilt Reichstag, the German people have completely reinvented themselves. The memories are there, and it is right that they should remain, but that past is indeed another country.