So-called manifestoes left by the terrorist attackers at Christchurch, New Zealand, and El Paso, Tex., have warned of this coming war too. They also say their attacks were intended to provoke more racial violence, hastening the fight’s arrival.

Radicalization requires little more than a community with like-minded beliefs, said Maura Conway, a terrorism scholar at Dublin City University. While white backlash to social and demographic change is nothing new, social media has allowed whites receptive to the most extreme version to find one another.

Mr. Berger, in his research, found that these deadly messages, which have had mixed success in traditional propaganda channels in all but the most dire historical moments, can spread like wildfire on social media.

He termed the message one of “temporal acceleration” — the promise that an adherent could speed up time toward some inevitable endpoint by committing violence. And the “apocalyptic narratives,” he found, exploit social media’s tendency to amplify whatever content is most extreme.

As with the Islamic State’s calls for mass murder, this worldview has resonated among young men, mostly loners, who might have previously expressed little ideological fervor or experienced much hardship. It offered them a way to belong and a cause to participate in.

And, much like the Islamic State had found, social media gave white extremists a venue on which to post videos of their exploits, where they would go viral, setting off the cycle again.

In 2015, Mr. Berger wrote that the Islamic State had been “the first group to employ these amplifying tactics on social media.” But, he added, “it will not be the last.”