As @Tom Au mentions, the newly found Republic of Turkey was led by Mustafa Kemal, later named Ataturk, or the Father of the Turks. Why was he named like this? Well, i'm glad you asked:
He was a person that inspired a lot of Turks to fight for their homeland - because now they weren't fighting in some colony taken centuries ago for the glory of some perfumed fat fellow in Istanbul - they were fighting for their own country, their own villages, their own families and friends. Esprit de corps is a powerful thing, Napoleon once said(kinda).
While during WWI the army was very poor, with low morale, extremely poor training, tactics and equipment, and as a result suffered heavy losses and embarrassing defeats (yes, Gallipoli is an exception mostly due to bad planning from the Allies, insufficient support and relatively high morale on that front, again because of Kemal's rallying prowess), post-WWI the new army was with somewhat decent equipment and supplies (Soviet Russia was helping a lot with both money and armament, in exchange for Batum), and once again - high morale. They were fighting to defend what was left of their country, and it's mainly that stubbornness that prevailed.
That and the fact that the Allies didn't have the will the continue the war - only the Greeks fought on, and they weren't all that powerful on themselves, their economy unable to support long term mobilisation without foreign aid(which was not incoming, the British were the only ones that supported them, and they were afraid to act not to antagonize the French), and with extreme political problems - their King got bitten by a monkey and died, then the government changed and quickly purged to - so far - successful army.
And from then on, the Turks, fueled with Soviet arms and money and home-grown patriotism, hand the upper hand.
Source - Wikipedia, Bulgarian History taught in High School, a book about the fall of the "Sick man of Europe" in Bulgarian whose name I cannot remember for the life of me...