A Canadian flag. The country is celebrating its 150th birthday. (Brent Lewin/Bloomberg)

Canada turns 150 years old today. Let’s admit that it is enjoying a bit of a moment.

It is a prosperous and free country. It has a government that works. Crime and corruption are rare. The economy weathered the 2008 financial crisis with minimal damage. With plans to ramp up clean energy and a commitment to legalize marijuana in 2018, Canada’s reputation is changing from boring to kind of cool.

Canada’s warm welcome for more than 25,000 Syrian refugees also won it global praise, especially when contrasted with the U.S. response. The Canadian way to settle refugees, in which groups of individuals raise money privately and take responsibility for the refugees’ first year in Canada, has become a model for other countries.

Yes, Canada has many reasons to celebrate, including a popular leader and its continued openness to new arrivals and international partners. But it could easily lose some of its shine in the future.

Canada’s leadership has helped — sometimes

No small portion of the current admiration is attributable to Justin Trudeau, the handsome prime minister. Like his father Pierre Elliot Trudeau, who served as prime minister in the 1970s, Justin has mastered the art of symbolic politics — he showed up personally at the airport to welcome Canada’s first Syrian refugees.

He uses social media to celebrate physics and the natural sciences. And sometimes he combines substance and symbolism, like when he picked a cabinet that was fully 50 percent female, a first for Canada. No wonder he became a heartthrob for progressive women all over the United States.

On July 1, 1867, you might not have expected such leadership from Canada. Its first prime minister, Sir John A. MacDonald, was an incorrigible drunk. True, this was in an age when a man could be completely blotto in Parliament, so sloshed that he had to hold the lectern while speaking for fear of falling over, and still be called “the Right Honourable.” Even by the standards of his day, Sir John A. was quite a lush.

So Canada’s early leadership was questionable. Its neighbor to the south was a rising global power, 10 times Canada’s size by population, then and now. The U.S. also waged war upon it in 1812.

Canada was a massive land in a hard climate, frozen for half of the year and mosquito-infested for the other half. If it was ever going to lure more immigrants to its shores, it was going to have to be pretty awesome on every other dimension. It set out to be just that.

What makes populism a tough sell in Canada right now?

Canada’s current luster is also undoubtedly attributable to its contrast with the populist policies that found traction in 2016 in the U.S. and Britain.

Unlike its closest cultural cousins, Canada continues to embrace a global outlook, relatively open borders and free trade. What makes Canada different?

It would be easy to point to the different social institutions, like Canada’s universal health care and a more equal distribution of economic wealth, to explain away the populist impulse and political polarization that grips America. No doubt that is part of the answer, but it only pushes the question further back. What about Canada’s political culture encourages these types of institutions?

A recent New York Times piece points out some partial answers, including strategic decisions by political leaders to court immigrant votes, and policies and lucky geography that lead to civil integration of immigrants.

Yet a missing part of the answer also seems to lie with “othering.” Social psychology teaches that distinguishing oneself from others facilitates identity formation, for an individual or a nation. Identifying the “other” is part of what binds a group together, by creating mental rules for who is in and who is out. There is some good research on this concept in political science.

“Othering” can be harmless, even beneficial, like when it builds community among sports fans cheering against a rival team. Taken to extremes, however, it can lead to bigotry or worse. I have argued elsewhere that it can help explain a lot of what we saw in 2016 on both sides of the Atlantic.

Canadians benefit from having a persistent “other,” namely the United States. It can be obnoxious: Canadian magazines have no trouble asserting that “Canadians are just better people.” Canadians are not the only ones to look down on Americans, of course, but nowhere else is it so central to the national identity.

Yet the United States and Canada have enough in common that Canada can cast the United States in the “other” role just enough to cultivate national unity without wrecking its relationship with its greatest economic partner.

Can Canada keep its luster?

Canada could easily lose its current status as a paragon of liberalism and upholder of international order. Since “othering” works by distinctiveness, the simplest way for that to happen would be if the United States and Britain recommitted to the multilateral institutions and economic integration that have made the international order work. They are bigger and more important players than Canada, and would outshine it. But it’s unclear to what extent, and for how long, Britain and the United States will turn their backs on the liberal order they built.

If the U.S. and Britain do recommit to a cosmopolitan outlook, Canada would have to keep improving to maintain its reputation and attractiveness to immigrants. It might do this in two ways. One is to maintain and improve its domestic society, offering economic prosperity and social justice. That could help its “soft power,” or leading by example. The other is to make contributions to the international order, like leading on the environment, NATO interventions or providing U.N. peacekeepers, which show that Canada “punches above its weight” as a country.

It isn’t easy to step out of America’s shadow and earn a place on the world stage. Go to it, Canada.

Jeff D. Colgan is the Richard Holbrooke associate professor at Brown University, a Bridging the Gap Policy Engagement Fellow, and @JeffDColgan on Twitter. This publication was made possible (in part) by a grant from Carnegie Corp. of New York. The statements made and views expressed are solely the responsibility of the author.