WASHINGTON — Three of the most persistent strands in President Trump’s political life — social media, race and glorification of violence — came together this week to provide a foretaste of what the coming reelection campaign will look like.

At one level, Trump’s fight with Twitter felt like — and was almost surely intended to be — a distraction from the continued COVID-19 pandemic, which officially claimed its 100,000th American life on Wednesday.

But it’s usually a mistake to dismiss Trump’s quarrels, however stunt-like they may be, as mere distractions. They provide insight into the mind of the nation’s chief executive and the tactics that he believes will help him.

It’s equally wrong to assume, as some do, that Trump possesses unerring tactical judgment. He does have a keen ear for what will stir up his followers. Whether that’s enough to win an election is very much a different question.

Twitter and Trump both existed before they found each other, but over the last decade, they’ve developed a mutually beneficial relationship.

Trump’s mastery of social media played a huge role in his rise, and his choice of Twitter as his preferred channel has boosted the platform’s presence.

Twitter’s great appeal to Trump is precisely the thing that at times makes his aides queasy: As he’s often said, it provides an unfiltered way for him to communicate his thoughts directly to his audience, bypassing reporters as well as chiefs of staff, lawyers and others who might try to control him.

For the public — and presumably for foreign intelligence analysts, as well — the president’s Twitter feed has provided an invaluable window into his insecurities, his obsessions and his growing enemies list.

Given the value he puts on the unmediated nature of Twitter, it’s no surprise that Trump erupted in outrage Tuesday when his favorite platform suddenly imposed a filter, however mild, on one of his missives.

The offending post — a false and misleading tweet about California’s mail-in ballot rules — wasn’t Trump’s most egregious tweet of the year, or even of the week, but it happened to involve a subject area on which the company had already announced a specific policy — “manipulating or interfering in elections or other civic processes.” Twitter added a box to the tweet, suggesting that readers “get the facts about mail-in ballots.”

Apparently, no one at Twitter had anticipated a need for a policy covering, say, falsely accusing a TV host of complicity in murder, as Trump did to former congressman Joe Scarborough, now an MSNBC personality.

Talk to Republican voters and you’ll get a very divided view of Trump’s tweets (Democrats almost universally condemn them). Many Republicans, like the suburban voters who abandoned GOP candidates in the 2018 midterm election, sigh or roll their eyes when they talk about his Twitter habit. At focus groups, those GOP voters, most often women, say that they like some of Trump’s positions but wish he would “express himself differently” or “tone it down.”

But Trump’s most ardent followers revel in the president’s punches.

In his disdain for social niceties they see authenticity, and his choice of adversaries reflects their own. Like his rallies, the tweets help bind together Trump’s tribe.

And it’s almost exclusively to those voters that Trump has decided to pitch. That’s especially true when, as now, news headlines are unfavorable to him.

Media critics on the left often say that Trump uses his tweets to distract attention from other topics, suggesting that mainstream outlets abet him by covering his messages. While there’s some truth to that, the criticism often ascribes far more power to Trump’s tweets than they have.

As much as Trump may want to change the subject away from the coronavirus and the economic collapse it has caused, nothing he said this week was going to do that.

Often, Trump’s tweets seem aimed at distracting himself as much as anything else. Rush Limbaugh, who knows a few things about creating controversy to attract an audience, captured that when he commented on Trump’s accusations about Scarborough:

“Trump is just throwing gasoline on a fire, and he’s having fun watching the flames,” said Limbaugh, who defended Trump, calling the tactic “clever.”

Clever may not be the right word. But in addition to self-therapy, Trump’s tweets do serve as a political mobilization tactic. They give talking points and marching orders to his followers and keep them outraged and engaged, especially by highlighting the alleged misdeeds of adversaries.

That’s the context for the hastily conceived executive order on social media that Trump threatened on Wednesday and signed on Thursday.

As Chris Megerian wrote, it was a legal hodgepodge that would probably backfire on Trump if it were ever put into effect. But as a piece of political theater, it succeeded in reinforcing Trump’s message — already believed by many conservatives — that the big social media platforms are conspiring against them.

The same context provided the backdrop for Trump’s tweets Thursday and Friday about the civil unrest in Minneapolis that followed the police killing of George Floyd, who died Monday after officers handcuffed him and one put his knee on the man’s neck, choking him.

In response to pictures of some people in Minneapolis breaking store windows during protests, Trump criticized the city’s Democratic mayor, Jacob Frey, as “very weak,” and threatened to “assume control.” He characterized those seen taking items out of stores as “thugs” — a label he almost never uses except in reference to blacks — and raised the specter of a violent police response, saying that “when the looting starts, the shooting starts.”

Twitter partially obscured the tweet, posting a notice that it violated the company’s policy against “glorifying violence,” but continued to allow people to read it. Later in the morning, the official White House account repeated Trump’s tweet, seemingly daring Twitter to filter it, too, which the company did.

For Trump, the controversy provides multiple advantages: It escalated his fight with Twitter even as it gave him a chance to assume the posture of toughness that he revels in and to remind his mostly rural, white backers about their dislike of big, Democratic cities and, often, of the black Americans who live in them.

Expect to see more such race-based appeals between now and election day. Like the tweets, they, too, help bind together Trump’s tribe.

Can that tactic succeed electorally?

The risk for Trump is that his language alienates more voters than it attracts, as happened after he appeared to excuse the neo-Nazi demonstrators in Charlottesville, Va., in 2017.

But Trump may decide that’s a risk worth running.

In 1968, civil unrest in major cities helped Richard Nixoncapture the presidency in part by playing on white voters’ anxieties.

Trump has often copied Nixon’s rhetoric. Copying his electoral path would be difficult — white people formed a much larger share of the electorate then than they do now, and urban unrest would have to get much bigger than looted stores in one city to take national attention away from the coronavirus.

But down in the polls and badly in need of a way to change the subject, Trump may well feel it’s the best play he has left.