We are learning about this time period leading up to WW1, in my history class and my teacher did not know the answer.
I'm just curious to see why.
Hungary was one of the major powers in Central Europe during the late Middle Ages. This bulwark against Islam was destroyed when Louis II and his army of 24,000 was crushed by the Ottoman Sultan, Suleiman, and his army of 150,000 troops at the battle of Mohacs on August 29th 1526. Louis II died without a heir and in 1527 the vacant crown of Saint Stephan was claimed by the Hapsburgs of Austria. Hapsburg "Royal Hungary" was only a thin strip along the northern and western fringe of the pre-1526 kingdom of Hungary. Most of that kingdom was controlled directly by the Ottoman Turks, but Hungarian nobles that were vassals of the Sultan ruled Transylvania.
After the Turks laid siege to Vienna in 1683 and lost a major battle, the Austrians began a thirty-five year long offensive. By 1720 AD, Austria had reconquered the territory that comprised the pre-1526 kingdom of Hungary. However, it was the Hapsburg family that wore the crown of Saint Stephan and were recognized as being the kings of Hungary.
A major revolt in 1848 tried to reassert Hungary's independence, but the Tsar of Russia helped the Hapsburgs to put down that revolt. After Austria lost its Seven Weeks war against Prussia in 1866, the Hungarians became rebellious again. Since Austria remained neutral during the Crimean war in 1854, the Tsar was no longer willing to help the Hapsburgs, so in 1867 they compromised. Franz Joseph remained as the King of Hungary, but Budapest became the seat of a practically independent Hungarian nation. The Austrian empire was replaced with a Dual Monarchy. The Hungarian half of the empire had its own laws and was co-equal to the Austrian half of the empire in the realm of foreign policy.
Source: "Central Europe: Enemies, Neighbors, Friends" by Lonnie Johnson