As the coup and its aftermath come into greater focus this week—with Erdogan’s reinstated government rounding up tens of thousands of security forces, judges, teachers, politicians, and other officials, and demanding the U.S. extradite Fethullah Gulen, an exiled Turkish cleric in Pennsylvania, for allegedly plotting the putsch—I asked Cagaptay why the explosion he feared had played out the way it did, and what might come next for Turkey.

The revolt against Erdogan failed in part because of basic math, said Cagaptay. Unlike past successful coups in the country, this one was not orchestrated by top military officials through the chain of command; instead, a faction of the security services, perhaps concentrated in branches like the Air Force and gendarmerie, appears to have been implicated. Erdogan retained control over much of the military and police force throughout the showdown. “There were probably more pro-Erdogan people with weapons than pro-coup people with weapons in the end,” Cagaptay noted. The rogue soldiers also squandered whatever public support they might have mustered by bombarding cities and firing on their own people.

But maybe more importantly, the coup failed because Erdogan won the information battle on two fronts. The putschists staged a “1980s-style” coup, Cagaptay told me, proclaiming their takeover on the public broadcaster TRT, which isn’t widely watched in Turkey these days. “Erdogan goes on his smartphone, does a FaceTime interview, puts it on social media, millions saw it,” Cagaptay said. “It was a victory of digital over analog, in terms of communications styles.” (Turkish cellphone-service providers reportedly ramped up call, text, and data packages during the tumult.)

What proved pivotal was not just the medium, but the message: In the interview, in Facebook and Twitter posts, in a text message sent to every cell phone in the country, Erdogan called for his supporters to take to the streets in defense of his democratically elected government. And they did, en masse, in the wee hours of Saturday. “That is the turning point of the coup,” Cagaptay argued. “That’s when the countercoup started to rise.”

Around the same time, according to Cagaptay, Erdogan urged imams to mobilize people as well, likely through communications channels maintained by the government’s religious-affairs directorate, which runs and funds Turkey’s 80,000 mosques. Mosque loudspeakers began issuing the call to prayer at an ungodly hour. “It would be the equivalent of church bells suddenly starting to toll all over the United States at 1:15 AM, and ringing for hours,” Cagaptay said. Erdogan was asking his political base, which includes many Islamists, to “flood the country.” The Wall Street Journal reports that Mehmet Gormez, the head of the religious directorate, “ordered thousands of imams to recite prayers known as ‘sela,’ ordinarily reserved for funerals and special religious occasions. When issued at other times, the prayers act as a call to arms for the Islamic community.” Within hours, people were clambering on top of tanks. The coup was a husk of its former self.