Despite having found his initial backing by the United States due to his "moderate Islam", "Pro-Western and Pro-American" and economically liberal policies, Recep Tayyip Erdoğan comes from a Sunni Islamist background. His foundations as a politician comes from being a protege of Necmettin Erbakan, whose ideology is based on Sunni Islamism and Euroscepticism. He abandoned his teacher and mentor in a controversial fashion in the early 2000s to found a new party, called AKP, and found support by the more economically liberal thinking and more Pro-American people in the old party of Erbakan's, such as Abdullah Gül. I've talked about the way he found strength on the forum earlier, but I'll summarize it quickly. AKP was founded during the heights of the early 2000s economic crisis in Turkey. Erdoğan's ideals of privitization and a Pro-Western approach brought a lot of interest from foreign investors, made Turkey a desirable market, resulting in hot money flow and a rapid growth in the economy. His background, the inept policies of the strong centre-right parties of the 90s (DYP and ANAP) resulting in them becoming irrelevant by the early 2000s and the liberal economic policies gave him a wide ranged crowd of supporters, made up of Islamists, Conservatives, centre-right interest groups and liberal businessmen.
The "glory days" of AKP in truth lasted until 2007. By that point a lot of Pro-Western conservative politicians started leaving the party. The success of the first term, which started in 2002, gave Erdoğan an incredible amount of support, which resulted him shattering records in the second election in 2007. Turkish people have a tendency to idolize politicians a bit. They have a tendency to prefer "one-man above all" instead of one strong political party or a more democratic way of politics based upon interests of different political systems. All in all, it's an history thing. The people of this country lived under the glory of the Ottoman Empire and its monarchs. Then when going got tough, Mustafa Kemal Atatürk was the person to idolize with his modernization policies. By the 50s, Adnan Menderes became a conservative legend. In the 80s Turgut Özal was the "one-man above all". The country went through a phase of coalitions in the 90s and the complete economic and social ineptitude of the coalitions strengthened the preference of a "one-man above all" idea even further. Erdoğan, to many, was that "savior" they waited for in the 90s.
During the economic crisis of 2008, the newly strengthened Turkish economy managed to go through it all without having an actual crisis of sorts while United States, which was essentially Erdoğan's big brother from get go struggled. Now, I'm not sure if this is actually legitimate or not, but I feel like the 2008 crisis gave Erdoğan a huge boost of confidence. Founded upon the support he received from the country, he started to meddle in with world matters to a way bigger extend. The peak of this newly found confidence was showcased in Davos, back in January 2009. Erdoğan clashed with Shimon Peres over Palestine, then walked off the stage saying "He'd never return to Davos ever again." He was praised as a "world leader" and became a cult hero among the Muslim world. The Davos Walk-Off wasn't anything more than a publicity stunt, considering the substantial increase of political, economical and social relations between Turkey and Israel during Erdoğan's term, but it was a publicity stunt that worked like a charm. By the time we reached 2010s, Erdoğan had an overwhelming control over the mass media in Turkey and media pushed the "world leader" agenda as much as they could. Around that time, Erdoğan was almost "Godlike" in the eyes of the people. Several AKP members even came up with absurd statements like "It's a religious service to be able to touch Erdoğan". The cult of personality reached incredible levels.
With European Union admission negotiations stalling, then reaching a point where it was almost irrelevant, Erdoğan becoming more and more authoritarian and polarizing in his approach, I think it was around 2010 that United States no longer saw him as that "potential leading figure of modernized Muslim world". But Turkey was still, obviously, a major ally.
Prior to 2011, the relations between Turkey and Syria were going pretty well. Maybe even too well. Erdoğan would refer to Assad as his "brother", and vice versa. They even took vacations together with their wives. If you were to single out a BFF for Erdoğan, it'd be Assad. Then, out of the blue, the tables turned. Erdoğan, out of nowhere, started calling Assad a dictator who agonized his people. He cut off all diplomatic and economic ties to Syria. What happened? Well, Erdoğan was in the United States to have a meeting with Obama, just days before he started slamming Assad. Overthrowing Assad became an ideal for Turkey as much as it was an ideal for the United States. The reasons were likely economy based, Turkey would probably get something, not clear what exactly, but something to their benefit from the overthrow of Assad. While the Syrian Civil War was going on, Turkey openly started training Free Syrian Army militants. Then, behind the curtains, they started arming the Assad opposers. The Turkish secret intelligence, MIT were accused of sending opposing groups weaponry with trailer trucks. Among those groups being armed were Al Nusra Front, Islamic Front, Ajnad al-Sham Islamic Union and then relatively-unknown to the world, Islamic State of Iraq and Syria. All of these groups have one thing in common: Sunni Islamism.
As the thing in Syria was going on, Erdoğan openly declared his support for the Muslim Brotherhood. He supported Mohammed Morsi in Egypt. During the time of the Egyptian coup d'etat, he started to publicly bash Abdel Fattah el Sisi and became even more fanatical of his statements of support for the Muslim Brotherhood.
Here's the crucial point for all this. Erdoğan, no matter how Pro-Western and non-Islamic he portrayed himself in the past, is a man of his roots. He wasn't going to throw away what he grew up believing in, started doing politics for and strived for. Politics is a game of benefits. It's a clash of pragmatism and ideologies. Erdoğan only did what needed to be done to achieve power and with his new found confidence in the late 2000s, started to push for his ideals. His ideal is to create a complete alliance of the Sunni Muslim world and become the leader of it. He's never been shy of secterianist statements. He wasn't trying to deny it, not trying to hide it. He has made discriminative statements about Alawites and has made sure to single out Sunnis whenever there was a talk of Muslims. When Reyhanlı, Hatay was attacked back in 2013 and 52 people were killed, Erdoğan said "52 of our Sunni citizens have been killed". Speaking of Reyhanlı, it became public through the works of an opposing newspaper that the attack's perpetrators were a group, then allied with Al-Qaeda. That group's name was Islamic State of Iraq and Levant. Erdoğan, or AKP in general never came clear about the accusations.
The truth of the matter is, AKP strived for a Sunni controlled territory in northern Syria that would have substantial benefits to Turkey and push his agenda of "Sunni imperialism" even further. And they thought Islamic State of Iraq and Levant was a possible candidate. That's why they never acknowledged their involvement in Reyhanlı, that's why they stayed away from pushing an operation further. Not because they thought about the risks , as pointed out by myself on this very thread quite a few times before, involving an operation; but simply because they were still hopeful of a Sunni controlled territory to be founded in northern Syria and then becoming their allies.
Assad hasn't been overthrown. United States backed down from their point of view and moved towards a "conversational" approach with Assad. Meanwhile Erdoğan has made it clear that for them to do anything to do with Syria, Assad needed to be overthrown. Now, when U.S. influence was the first thing that made him turn the tables on Assad in the first place, why did he carry on asking for him to be removed? Because that U.S. influence I talked about became crystal clear in the eyes of the general public. People knowing that he wasn't this "world leader who didn't give a shit what anyone else thought" but merely a puppet for a big brother would absolutely destroy the image he had. Therefore he had to go on his way, pretending that he was the one pulling the strings. When in reality everything came clear over time. Erdoğan, with his fanatical Sunni Islamist imperalist viewpoint, his cult of personality that he himself got caught up in, tried to create his own "little brothers" and failed. Immensely. And now the country has to pay for his delusions.