During Tuesday night’s pole vaulting finals at the Rio de Janeiro Olympics, Brazilian Thiago Braz da Silva won a surprise gold medal and was met with wild cheers. His opponent, France’s Renaud Lavillenie, was booed, but not for any clear reason. This (and, presumably, losing) caused Lavillenie to break down in tears and the International Olympic Committee’s President to issue a condemnation of Brazilian crowd’s behavior. It was an ugly episode. But it wasn’t a surprising one. Brazilian partisans have long had a reputation for unchecked enthusiasm and the nationalism inspired by country versus country competition always makes matters worse.

This is not just a Rio problem.

So-called patriotic behavior is often disturbing on second glance. Psychology is rife with examples of in-group and out-group behavior — how people act in groups with mob mentality versus looking from the outside in. People get caught up in the fandom, becoming soccer hooligans in the same way, sociologically speaking, that they become complicit in genocide. Our impulse toward group violence is an evolutionary bug we can trace back to when we traveled in packs.

Nationalism hurts.
Nationalism hurts.

Social psychologist Daniel Druckman has focused on nationalism-veering-into-exceptionalism throughout his academic career. He argues in a seminal 2010 paper on the subject that most conflict can be traced back to intergroup divisiveness rooted in the basic human instinct of taking sides.

The long story is that humans evolved in small groups. We’re not very strong creatures. There’s lots of other animals — lions or tigers or gorillas — that for their size are much stronger, or they have sharp teeth or claws, or can run much faster than humans. So what really sets humans apart is our capacity towards cooperation and working together in groups and communicating with one another to achieve our goals.

So you’re predisposed to have an us versus them mindset: that makes sense, and is something science has shown with racism as implicit. The problem is when nationalism tips over into xenophobia.

And while Brazilian nationalism has gone viral in the past week, it’s important to remember that Americans are caught in a wave of nationalism this election season thanks to Republican presidential candidate Donald Trump’s xenophobic rhetoric. Think back to the Republican National Convention, when Trump joined delegates in a chant of “U-S-A! U-S-A!” That three-letter mantra also has made plenty of rounds the past couple weeks, and it’s TV ratings gold.

This is not to say that rooting for your home country is problematic. Having allegiance to a team in sports is what makes them fun and competitive and a blast to watch. There’s a certain level of schadenfreude when you see a rival team lose. But when your allegiance turns into blind fury at the other side, politics become problematic. Sportsmanship isn’t just important because it keeps brawls from breaking out. Rivalries have to stay friendly in order for sports to remain sports rather than simulated warfare, which is where our brains naturally go.

After all, Brazilians don’t hate the French. And they don’t generally hate pole vaulters. They just like being Brazilian. When they focus on that, everything works out. Same goes for Americans. As long as we focus on our own achievements, we do just fine.

Photos via Getty Images / Quinn Rooney

Tanya Basu is the Science editor at Inverse. Her writing focuses on the social sciences and behavior. Now based in Brooklyn, she will always call Chicago home and never be too full for one more taco.