Kempelen was inspired to build the Turk following his attendance at the court of Maria Theresa of Austria at Schönbrunn Palace, where François Pelletier was performing an illusion act. An exchange afterward resulted in Kempelen promising to return to the Palace with an invention that would top the illusions.
I find it absolutely hilarious that his invention to top the illusions was another illusion.