A correspondent writes,
The coup in Turkey was a fake meant to facilitate the arrest, removal, and replacement of its western-oriented legal system by a fundamentalist Muslim shariah law system.
The coup ended too quickly, with little real combat. It did not unfold like a normal coup, but like a staged drama. For example the regime was ready much too soon with arrests of a long list of judges and prosecutors who could not have had anything to do with military activity, but who were a barrier to imposition of shariah law.
The logic of coups has been worked out. There is an extensive literature and most any coup plotter would have read some of it.
He surely would have read Edward Luttwak's 1979 book, Coup d'Etat: A Practical Handbook. He would have known to arrest or kill the present head of state and, nowadays, to shut down the internet.