I entered a puppet shop in Prague and peered towards the back corner into a room, where sculptors were busy at work creating life out of wood. Once the eyes were painted on, a figure emerged. It wasn’t long before the shop owner pulled the strings to see how realistic he could make the puppet appear. I stood near those doors, watching and wondering if the sculptors knew the history they were holding in their hands.

Because it was thanks to the humble puppet that the Czech nation – and its language – was inadvertently saved.

You may also be interested in:

• Why people think Germans aren’t funny

• The town that’s losing its language

• Europe’s most endangered language?

In the 17th Century, when the kingdom of Bohemia was under Habsburg rule, the Czech language almost disappeared. When Bohemian Protestants lost the battle against Catholic forces at Bilá Hora (White Mountain), located in the present-day Czech Republic, it set the stage for an Austrian rule that would escalate already deep political and religious divisions in the region. The loss would sweep across and further divide Europe, and incited the Thirty Years War, where Czech Protestants were dominated by Catholics. But something more than power was at stake: a people’s identity and language.

When the Protestant court left Prague in the early 1600s, the city fell into decline for almost two centuries. The new ruler, Ferdinand II, did not tolerate non-Catholics, viewing Protestants as a threat to his faith. Czech locals, mostly peasants and working class people, were forced to speak the German language of their invaders. Soon after, intellectuals, who had initially resisted the German language, followed suit. Even Czech actors began to perform in German as an official mandate. Czech became a mere dialect, and would have slipped into oblivion had it not been for some unassuming pieces of wood.

The act of building puppets has long been a form of protest for the Czech people. Seventeenth-Century wood-carvers, who were more versed in sculpting Baroque seats for churches than human facsimiles, started making puppets for the actors of Bohemia soon after Ferdinand II came to power, as puppets were the only remaining entities that had the right to speak Czech in public places. While the rest of the country and its people adhered to the newly imposed German language, wandering actors and puppet-masters spoke through the puppets in their native Slavic tongue.

It might seem unlikely that a few hundred puppets and puppet-masters could safeguard a language, especially through a loophole, but the people’s last remaining legacy to their past was tied to the puppet’s strings.

It’s easy to see why these marionettes have found a home in Czech hearts, and why the magic of puppets continues to permeate the city.

Walk around Prague and it won’t be long until you see a puppet shop, or at the very least, a souvenir bazaar with puppets dangling from the ceilings or window frames. Most puppets are still made from wood and hang on strings like their predecessors. They dangle in shop windows, looking out as if begging onlookers to take them home and bring them to life. Still carved in the traditional forms of kings, queens, witches, peasants and animals, it appears that not much has changed, except the fact they’re now mostly for children and decoration instead of protest.

In the streets, puppeteers make magic happen. I watched a puppet show in a charming cobblestoned square, where the puppet-master wore the velvety cap of a pageboy, pierced by a single plume that swayed along with the puppet’s movements. He used his puppets to beckon bystanders. Melodic medieval music accompanied the dance of a peasant male and young princess, a Czech love story with a plot twist that favours the underdog, the peasant who wins the heart of a far-fetched royal love.

Not far from the Jewish sector, in the heart of Staré Mĕsto, I came to the National Marionette Theatre, a place that draws locals and foreigners alike for live puppet shows. As I listened to the Don Giovanni puppet show from an open window and heard the strong intonation of Czech words, I couldn’t help but wonder how different it would sound in German if artists and artisans hadn’t restored Czech to its people. I wondered if those who walked by, speaking Czech, realised they speak a language that nearly died a few centuries ago, but was protected by the city’s actors and their puppets.

CORRECTION: An earlier version of this story erroneously stated that the word 'robot' was coined to describe how Czechs felt during communist reign. We have removed the text.

Why We Are What We Are is a BBC Travel series examining the characteristics of a country and investigating whether they are true.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital and Travel, delivered to your inbox every Friday.