A lot of this could be outside forces that want to overthrow erdrogan??
The military under Ataturk was meant to be the protector of a secular, nationalist Turkey, modeler after Ataturk's vision of a futuristic Turkey. As a result, senior ranks of the Turkish Army were filled with the previous generations appointing future generations who had the same world-view as them. This resulted in the Turkish Armed Forces behaving like a much more diluted version of the Pak Army(without the corruption part), by maintaining pressure on the civilian government if it became overtly Islamist, and at times conducting coups as well, but surprisingly characterised by really low levels of corruption and the eventual return of democracy and civilian governments once things cooled off. The civilian population also generally supported their major crackdowns on Islamist orgs like the Grey Wolves and the AKP. If you want to read more about the Turkish Armed Forces' rather strange relationship with the civilian government and how it continues to date, read about the 2007 E-Memorandum or the 1997 memorandum.
However, this changed in 2016 with the coup against Erdogan, as for the first time in decades, the public were against the military and supported Erdogan. I remember seeing the television when I stayed in Bursa where Erdogan made face time public calls and rallied the people of Turkey. As a result, the Turkish Army was unable to take control, and after Erdogan returned, he promptly cut off the fangs of the Turkish Military by just executing the Generals who lead the coup and those who were Kemalist, replacing them with hardcore Islamists. This resulted in the tradition of the Turkish Army being the Guardian of Turkish Secularism dying out, empowering Erdogan to push through dictatorial and Islamist reforms like the abolition of the Presidential System of Govt. in 2017, and the gradual degradation of the Turkish Armed Forces' professionalism.
EDIT: Outside forces, when they exist, aren't really powerful in Turkey. Gulen and his followers are widely hated in Turkey even among the Turkish Urban population, which is generally more Secular and Westernised. The Erdogan supporters are mostly the rural voters, with the cities being as modern as Europe, and the people being fully secular. Never saw a single hardcore M in any of the major cities of Turkey myself. Though this is anecdotal, this can also be seen in the voting patterns of the referendums over the last 4 years, with Erdogan relying on support from the rural areas.