I had always been under the impression that The Ottomon Empire had been a long-standing enemy of Austria (I blame the Baron von Munchausen) but came to the realization the other day that they had allied themselves with both Germany and Austrio-Hungary during WW1. It seemed odd to me that they would join with historically contentious partners such as this. What was the cause and rationale behind it?
At the risk of being shot down for lack of depth/ citations, the Ottomans and Russians had only recently fought the Russo-Turkish War from 1877–1878, which also included a coalition of Bulgaria, Romania, Serbia, and Montenegro. These same Balkan states were on the side of the Allies in WWI, so it stands to reason that the Ottomans would side against them, particularly as there were territories lost in this earlier conflict they wanted to reclaim.
First, you're forgetting Bulgaria. The nation that defeated the Turks and reclaimed their land. The Central power alliance included of Germany, Austria-Hungary the Ottoman Empire and Bulgaria. Now Bulgaria was the strongest Balkan nation (also one of the strongest in Europe). The Ottoman empire felt that having a secure foothold in the Balkans would reduce the chance of another invasion such as the first Balkan war.
Really, it was for protection. The Ottoman Empire wanted to be allies with Bulgaria more than Germany and Austria.
The Ottoman Empire was in a heavily decline in WW1, especially after their major losses in the Balkans.