Russia and Poland began openly quarreling over World War II history well before the start of 2020, the year commemorating the 75th anniversary of the war’s end. Poles had been pulling down Soviet war monuments scattered around their country in recent years, and in December, Russian President Vladimir Putin suggested that Poland had invited the war with the Nazis.

Both countries obsess over World War II. They have good reason, but the quarrel says less about each side’s real values than it does about the political tools nationalist governments use to mobilize support against domestic opposition. Russian and Polish leaders may appear to be bitter enemies, but Poland’s conservative government plays too many tunes from the Putin repertoire for it to be coincidence. That includes tightening the grip on mass media, undermining the independence of the judiciary, promoting “traditional values” (which translates into denying rights to the LGBT community, for a start) and, last but not least, having a soft spot for President Trump. What’s more, they are both cynically using history to rouse patriotic fervor in a self-serving effort to sideline internal political adversaries.

It wasn’t until the late 1980s that newspapers and magazines in Russia revealed the truth about Joseph Stalin, including his secret 1939 pact with the Nazis, the Ribbentrop-Molotov protocols, which divided Poland between the U.S.S.R. and Nazi Germany. In 1989, the Soviet parliament condemned the protocols, declaring them null and void. But a decade later, Putin steered Russia toward jingoist nationalism, and now he whitewashes and weaponizes the country’s history for political ends. All authoritarian-leaning nationalists do that, especially those in eastern and central Europe, where nation-building myths are based on sanitized and twisted versions of history. Poland, whose right-wing government made it a crime to accuse Poles of complicity in the Holocaust (the law was reversed after an outcry from Israel and the United States), is no exception.

Victory in World War II is the most fundamental myth of post-Soviet Russia’s statehood, the only thing that really united millions of very different people. The simple reason is that you would be hard-pressed to find a Russian family without someone who fought and died in the war, which cost 27 million Soviet lives. With millions of soldiers still lying where they fell, in the cold swamps of western Russia, waiting to be found by volunteer diggers and properly buried, it often feels that that war in Russia is not even over.

Its legacy is therefore the most convenient material for promoting the politics of outrage. Russia’s World War II cult is nothing short of a religion, as anyone who has been to the annual May celebration in Moscow’s Victory Park can attest. This raw emotion was masterfully used by Putin when the presence of far-right militants among Ukraine’s Maidan revolutionaries allowed him to frame the annexation of Crimea as part of a noble battle against resurgent fascism in Europe.

It was this outrage that Putin was stirring up when he suddenly lashed out against Poland on Dec. 20. He promotes the 75th anniversary of World War II as the central event of 2020, beginning with last week’s commemoration of the Soviets’ liberation of Auschwitz, the largest of the Nazi death camps. Just before the year started, he began mobilizing his base of support in the face of a perceived attack on the nation’s symbol of faith.

Poland’s nationalist government had kindly provided fodder for Putin’s patriotic campaign when it embarked on removing the Soviet memorials. But as he was building his angry argument, Putin wasn’t really talking to the Poles or the international community. His target audience was clearly Russian people whose grandfathers fought in the war and who certainly don’t see their ancestors as Nazi-like murderers who wanted to enslave Europe, as they are pictured by right-wing politicians in Poland and other East European countries. “Those Red Army soldiers, who are they?” Putin asked, referring to people whom the Polish monuments commemorate. “Mostly peasants and workers. Many of them suffered from the very same Stalin’s regime — some of them were punished as kulaks, others had their relatives sent to the camps. These people died liberating Europe from Nazis.” Some 477,000 Soviet soldiers perished fighting the Nazis in Poland, according to the Russian National Military archive — more than all American casualties in the war. The figure doesn’t include Soviet soldiers gassed or starved to death in Nazi concentration camps on Polish territory — 15,000 in Auschwitz alone.

But Putin went beyond calling out what he saw as the unfair treatment of Soviet soldiers’ memory by Polish and other European politicians. Downplaying the Ribbentrop-Molotov pact — everyone engaged with Hitler at the time, he said — Putin said that Polish leaders had created conditions for the German occupation of Poland. He cited numerous archival documents, including a dispatch from a prewar Polish ambassador to Germany, in which the diplomat expressed enthusiasm about Hitler’s plan to resettle European Jews in Africa.

As for the Poles, millions died in World War II, which started with Hitler and Stalin carving up their country. Almost 22,000 Polish prisoners of war and members of the political elite were massacred by the Soviets. This crime, best known after the main killing field in Katyn, is one of the formative elements of modern Polish national identity. In his retort to Russia, published by Politico, the Polish Prime Minister, Mateusz Morawiecki, wrote, “Far from being a ‘liberator,’ the Soviet Union was a facilitator of Nazi Germany and a perpetrator of crimes of its own — before and after the liberation of Auschwitz.” Without commenting on documents cited by Putin, Morawiecki offered a host of equally real and valid examples that tarnish Russia’s reputation as a key force in the fight against the Nazis. He went on to say that the Soviet occupation of Poland cost it “millions of lives” — a claim that many historians will find dubious.

The exchange of inflammatory verbal attacks are sure to continue. A report on Monday quoted the Polish foreign minister, Jacek Chaputowicz, as nonchalantly declaring Poland’s victory over Russia in this quarrel. One doesn’t have to be an oracle to predict that the Kremlin will respond. And the confrontation — in which the two governments, instead of actually talking to each other, strive to agitate their nationalist constituencies for mutual advantage — will continue toward the next big date of the anniversary year: The Russians celebrate victory over the Nazis on May 9, the Poles on May 8.

It’s often said that in conflicts, both sides lose. It’s just the opposite in this case. Here’s how it works: Putin triggered the current confrontation in December knowing that in just a few weeks he would announce sweeping political reform — a “constitutional coup,” according to members of the Russian opposition. Meanwhile in Poland, the ruling Law and Justice party is bogged down in a conflict with the European Commission and the country’s own Supreme Court over judicial reform seen by the Polish opposition and Brussels as an attack on the rule of law.

A history spat with a sworn historical enemy may serve as a welcome — and safe — diversion from both governments’ domestic challenges. And it illustrates the symbiotic relationship between outwardly hostile frenemies who feed off each other as they help advance the same illiberal trend that has engulfed Europe (and the United States) in the past decade.

There is no true equivalence between Russia’s deeply embedded authoritarianism and Polish illiberalism, of course, but liberal Poles have long feared that the country could be moving in Russia’s authoritarian direction. The Communist-era Polish dissident Adam Michnik said in 2009 that instead of a full-blown version of Putinism, other post-Communist countries, including his own, were nurturing a softer version of the same political arrangement. He called it “Liliputinism.” Whenever Putin needs to mobilize Russians around a patriotic cause, the help from Eastern European “Liliputins” is indispensable. It works the other way, too.