A Danish ad encouraging couples to have more sex has recently gone viral. The ad, created for a travel agency, specifically encourages couples to go on vacations where they can “Do it for Denmark.” Even potential grandmothers are brought into the mix. As a grandma struggles to help her son undo his wife’s bra, we learn that there is a better solution: if couples take vacations, they’ll naturally produce more grandchildren.

The ad is part of a national attempt to increase the country’s low birth rate, which is necessary for Denmark to thrive economically and sustain its social welfare programs. “The Danish welfare system is under pressure. There are still not enough babies being born, despite a little progress. And this concerns us all,” the ad warns. A low birth rate means that the ratio of younger people to older people is decreasing — the fewer young people, the fewer workers who can contribute to the welfare system. In other words, the ad implores citizens to “Do it for Denmark” in order to save the country’s economic future.

Meanwhile, hundreds of miles away in Lebanon, a different Danish ad has also received considerable attention. The ad, placed in Lebanese newspapers, warns that Denmark has tightened its regulations concerning incoming refugees. “The social benefits for newcomer refugees will be reduced by up to 50 percent,” the ad notes. Incoming refugees will also “not have the right to have their family brought to Denmark during the first year.”

On the one hand, Denmark is actively encouraging an increase in the birth rate in an attempt to ensure that its working population is large enough to support the welfare system. At the same time, however, the government is warning incoming refugees — potential workers — to stay away.

These disparate ad campaigns are explained by a growing conservative movement in Denmark, one that emphasizes nationalism and a strict immigration stance. In the June 2015 election, the Danish People’s Party (DPP) made waves, winning second place overall. Previously, the DPP had been a marginal influence; its heavily anti-immigrant and anti-European Union views are considered so extreme that Danes polled before the elections were hesitant to say that they supported the DPP at all, and polls dramatically under-predicted the DPP’s win. The rise of the DPP can partially be explained by a February 14 shooting that wracked the country. The attack, carried out by a man of Palestinian descent, left two dead and five injured. It affected both liberal and conservative parties, and caused former Prime Minister Helle Thorning-Schmidt, once leader of the liberal-leaning Social Democrats, to campaign for stricter immigration protocol.

Yet, the DPP didn’t succeed solely based on their anti-immigration platform. The party adopted a new strategy in the recent election — one that is exemplified by the two contrasting Danish ads. Many of the arguments against immigration resemble those in other nations: immigrants steal jobs, change the national culture, and increase the crime rate. But the DPP has also argued that the rise in immigration is at odds with the welfare economy. Incoming refugees need the welfare system to get a foothold in the country — an increase in refugees would, at least in the initial stage, further stress the system. The DPP postulates that, even after the initial stage, the welfare system could never recover because immigration and welfare aren’t compatible. The Danish welfare system is based off the concept of “Flexicurity,” meaning that the government provides tax-subsidized education and training programs, and the majority of jobs are for highly-skilled workers, who then pay high taxes. This system, according to the DPP, only works for these highly skilled workers, and immigrants lack the language skills or knowledge of social practices to meet the demands of the labor market. In the DPP’s view, immigrants take advantage of the welfare system, without contributing anything in return. This emphasis on welfare has helped the DPP win over both conservative voters, who object to increased immigration, and more liberal voters, who want to ensure that the welfare system remains functional. Though the DPP was once considered a marginal, extremist party, the increased emphasis on welfare, along with the appointment of a new, younger and less divisive leader, has broadened the DPP’s support base.

"Denmark is actively encouraging an increase in the birth rate in an attempt to ensure that its working population is large enough to support the welfare system. At the same time, however, the government is warning incoming refugees — potential workers — to stay away."

Germany presents a starkly different example. The German birth rate is the lowest in the world, with 8.2 babies born each year per 1,000 people. This could cause a 16 percent drop in the population by 2060. Unlike Denmark, Germany is offering asylum to more refugees than any other European nation. Hans Kundnani of the German Marshall Fund of the United States in Berlin has said, “You can look at this as Germany pursuing a national interest in the sense that Germany has a long-term demographic problem…Often refugees are young, smart energetic people who make an economic contribution to the country they come to.” With the most serious demographic problem in the world, Germany can’t afford to discourage the immigration that could stave off crisis.

Germany’s solution has downsides: the dramatic change in population dynamics has led to xenophobic violence and some civil unrest. For example, some Germans are protesting the possibility of a seismic shift in German culture, a trite argument that is a go-to for those opposed to certain kinds of immigration. The number of acts of aggression against refugees has risen from 198 in 2014 to 202 as of August this year; debate over immigration has become heated, and calls into question whether Germany has changed since the Nazi era. In one particularly dramatic attack, an apartment complex intending to house incoming refugees was burned to the ground, allegedly by right-wing arsonists. Wolfgang Hempel, a resident of the town, told the Washington Post, “Germany is turning black…Soon only dark-skinned people will be living here. It can’t go on like this. . . . And these days, everybody puts you in a Nazi corner just for voicing your opinion.”

German anchorwoman Anja Reschke recently condemned both verbal and physical attacks against refugees, but also pointed to Germans who remain quiet in the face of rampant xenophobia. The critique went viral, and Reschke received an outpouring of both support and criticism. Regarding the backlash, Reschke said, “And then there were the people who said, ‘Look, I’m afraid our race is getting polluted by all those evil people from the whole of Africa, but no, I’m not a Nazi.’”

It’s also unclear if this strategy will work economically: a 2001 report from the population division of the United Nations estimated that Germany would need an average of 324,000 immigrants per year to keep its population from shrinking. The argument has been contested, and other analysts suggest that immigration could nonetheless help. But the German government clearly believes that the economic effects of this immigration — as well as the moral need to offer asylum to refugees fleeing war and political corruption — outweigh the potential downsides. Despite the increase in anti-immigrant violence, the country seems to agree in part — unlike Denmark, Germany has not experienced a dramatic rise in support for anti-immigration parties.

Germany’s policies suggest that the solution to a national demographic crisis, and the associated strain on the welfare system, may not be anti-immigration policies. But for both Denmark and Germany, the choice is not an easy one. Each country must consider the morality of the turning away potential refugees, as well as weigh their obligations to their current and future citizens. It’s unclear which strategy — cracking down on immigration or welcoming it — will ultimately be successful, but the outcomes will affect each nation’s population and economic conditions for years to come.