The Ottoman state experienced significant growth during the reign of Bayezid I. He led a series of successful campaigns in the Balkans and Anatolia over a period of 13 years. The Kapikulu corps was expanded, which led to the alienation of many social groups. The Turkoman lords felt threatened by the growing importance of the sultan's professional standing army. Many people in Anatolia viewed Bayezid I unfavorably, which prompted some Turkoman beys to seek aid from the Timurid Empire.
Timur, the leader of the Timurid Empire, had recently completed his conquest of Iran and Azerbaijan. He was eager to gain allies and sought the support of the Turkoman beys. This alliance was a dangerous development, as Bayezid's arrogance and overconfidence in his military strength made conflict unavoidable. The Battle of Ankara in 1402 was a decisive victory for Timur's army. Many Turkoman beys switched sides, leading to the collapse of Bayezid's army. The Devşirme and Kapıkulu corps maintained their formation, but Bayezid refused to withdraw, resulting in his capture.
The defeat of the Ottoman army at the Battle of Ankara was a result of divided loyalties and the rapid military transformation policies of the central state. The rest of the century would be marked by competition between the Devşirme and Kapıkulu military and political class in the Balkans, and the provincial Turkic military and political class in Anatolia. This competition would shape the future of the Ottoman state. The social groups were affected by the changes, and the alliance between Timur and the Turkoman beys was a key factor in the defeat of the Ottoman army.