The treaty of Lausanne was signed following the Greco-Turkish war, part of it stipulated a population exchange between Greece and Turkey, Christians in Turkey were expelled to Greece, and Muslims in Greece were expelled to Turkey.
Bit of a follow-up: why did Albania and Bosnia Islamize, but not Greece (as in OP) or Bulgaria?
May I tag on a request for a recommendation on a good book on the Ottoman Empire?
This is in fact a question I've been waiting for to be asked on here for a very long time! For one, the Ottoman rule in Greece spanned some 500 years, starting in the 15th century and ending definitely in 1912!
There were many domestic converts to Islam in Greece, especially prevalent in Macedonia and the northern regions. Places like Kavala, Komotini, Florina, Edessa, Larissa, Thessaloniki, Rhodes, Kos, Chios, Lesbos, Evia and later Crete were full and in some cases had a majority of a Muslim population. Here in fact is an 1861 ethnic map of the Balkan peninsula, all 'Muslims' were considered as Turks regardless of background and so a large proportion of those red parts in this map are Muslim Greeks (some of these were called Vallahades).
Beginning in 1821 and up until 1923 there were constant attacks on the Muslim population, the 1821 revolt and Greek war of independence led to the massacre and deportation of all Muslims in the Peloponnese, later followed by Cretan revolts (Crete actually had the highest rate of domestic conversion to Islam out of any place in Europe, including Bosnia and Albania), and the Balkan Wars of 1912 ,as well as Greco-Turkish wars of 1919-1922 led to the slow but definite disappearance of Muslims from Greek lands, culminating in the 1923 population exchange and Lausanne treaty in which all Greeks from Anatolia were 'swapped' for Muslims from Greece. Though it should be noted that Western Thrace Turks were exempt and a sizeable community of 50,000-100,000 still exists in Greece.