Erdogan has an extreme amount of support within the country not just from the people but from the Turkish intelligence services & military aswell. A lot of people have elevated him to the same level as Ataturk.
I'm about 80% sure Erdogan will manage to retain power from just what I know about Turkish politics - which isn't a lot to be honest.
Early days right now but seems like the coup forces have advantage but that's largely because a lot of the soldiers don't realize that it's not the Generals who approved this but rather some lower level colonels.
Once, the soldiers find out they're defying the generals then they'll likely back down and Erdogan will retain power.
But once again - very early days.
EDIT: Grammar - I typed the comment way too fast.