Earlier this year, the Democratic National Committee began selling T-shirts on its site with a punchy slogan: “Democrats give a shit about people.”

They were, of course, just following the lead of Democratic National Committee chairman Tom Perez, who has said that President Trump “doesn't give a shit about health care."

He’s not the only prominent Democrat who’s been known to curse in the heat of the moment. In an interview with New York Magazine, Senator Kirsten Gillibrand, a Democrat from New York, explained that if lawmakers are “not helping people, we should go the fuck home.”

Meanwhile, Representative Beto O’Rourke, a Texas Democrat, claimed Republican Senator Ted Cruz is “sure as shit not serving” his constituents.

On the other side of the aisle, there’s the president himself, who lets vulgar words fly both when he knows he’s being recorded—and when he doesn’t.

It might seem strange that politicians swear so much when their speech is supposed to be carefully calibrated to win over voters. Why say something many people find offensive if your goal is to be as likable as possible?

It could be because research suggests that swearing in public—even in the office—can sometimes make people like you more.

When people are trying to be persuasive, swearing can help them drive their point home. One study of Italian adults found that, when fictional political candidates swore in a blog post, voters formed a better impression of them. Past studies also showed that saying “damn” in a speech about college tuition made the speaker seem more persuasive.

Swearing has become more acceptable in American culture: Swear words appear dozens of times more frequently in books published these days than in those published in the early 1950s.

But profanity is still a little bit taboo, and politicians might be using that to their advantage. Sometimes, swearing can make you sound like you’re using a secret code. According to Indiana University English professor Michael Adams, politicians who swear might be capitalizing on something called “covert prestige,” or trying to prove that they're authentic Americans. Rather than buttoned-up, standard American English, which has “overt prestige,” they might be appealing to a smaller group of voters by loosening up their speech and talking like an everyman. That's why, for example, politicians who visit the south may sound folksier and more religious than they usually do. And when Trump would talk to his base—many of whom were economically frustrated, blue-collar workers—he would promise things like taxing the “motherfuckers” in China, as he did in 2011.

This same trick might work for people who aren’t running for office. As long as your office is a little more Mad Men than Leave It to Beaver, and you’re not using expletives to insult anyone, it might be okay to let the occasional four-letter word fly.

A paper published this year found that white-collar workers in the United Kingdom, France, and the United States used swearing to get attention or convey urgency, as well as to develop friendships and build solidarity. Women would swear to demonstrate their assertiveness in male-dominated offices, or to earn respect from their male colleagues. Yet another paper that studied how coworkers say “fuck” around each other found they were saying it as a sign of friendship. “It is as if they are saying, ‘I know you so well I can be this rude to you,’” the study authors explained.

One study of Swedish workers similarly showed they used swearing to relate to each other. The person who swore the most in this study was an older man who went by the pseudonym Igor. He often would try to support his coworkers by just repeating whatever they said back to them, but with a swear word inserted: “Exactly, that is damn difficult!”

And in some cases, swearing can also help you break into the workplace “in crowd.” In one 2007 study, a researcher embedded with some warehouse workers. The most senior worker—whom he called Ernest—would haze the researcher and excluded him from the group. One day, Ernest was belittling the researcher, so the researcher cried out, “Well f***ing get on with it then, you lazy c***!”

The other workers gasped in shock, but Ernest smiled. And he stopped excluding the researcher for good.