The Free City was the result of a strategic impasse over the fate of Krakow and its fortresses in the aftermath of the Napoleonic Wars. In the negotiations at the Congress of Vienna, Prussia, Austria, and Russia all desired control of the city of Krakow, both for its fortresses and strategic location. Control over Krakow could allow an army to invade either Western Galicia or southern Poland. The solution to this dilemma was to create a nominally independent micro-state, the Free City of Krakow. By neutralizing Krakow i this fashion, it allegedly helped to ease tensions between these three powers.
Austrian leaders were not entirely satisfied with this arrangement. Emperor Alexander II at Vienna was tying with being the patron of Polish nationalism and although there were elements of the emerging Polonophobia of the Russian state in 1815, the fear for Austria was that Russia could champion Polish irridentism throughout Galicia. Therefore Metternich had the duchies of Zator, Oświęcim, and Żywiec created as part of the German Confederation. It became imperative for Metternich to have the German confederation directly share a border with the Krakow microstate so that any Russian attempt to restore Poland would meet the forces of the Confederation. Austria could then present a threat to Krakow's independence as a threat to the German confederation, which Austria politically dominated in its first decades, and not as a strictly Austrian affair. Metternich's solution was fortuitous in 1846-7 when Austria was able to use the duchies as a staging ground to invade and annex Krakow. With the overall strategic rationale for including the duchies now moot, they left the German Confederation in 1850 and became a component of the Kingdom of Galicia and Lodomeria and the Free City became a Grand Duchy of Krakow and a part of Austrian Galicia.