And to a latter extent why did it unify under Prussia?
The Congress of Vienna (1815) convened towards the end of the Napoleonic Wars and Austria & Prussia emerged as rivals. For the German states, this resulted in the disbandment of the old Holy Roman Empire in favour of a Confederacy with Austria holding the presidency (albeit limited authority). The Confederacy was designed to maintain stability in central Europe and structured to not become a nation. Pushed forth by Metternich, the Austrians wanted to restrict Prussia and put an end to the growing forces of liberalism and nationalism. During this period (1815-30), censorship increased and many liberals were arrested. The Carsblad Decrees of 1819 were the set of laws the Confederacy issued to strengthen the conservative response.
However, in 1848 the calls for change resulted in a series of revolutions across the continent. Liberal ideas from the French Revolution influenced a growing middle class that became disillusioned with protectionist barriers, limited freedom of press, the lack of a constitution and assemblies among other reasons. The revolution hit Austria very hard, which forced the abdication of Metternich.
In the German states, revolutionaries such as Gustav Struve attempted unification through the Frankfurt Parliament (1848) without Austria (the so-called 'lesser solution'). The March Demand in Mannheim called for freedom of press, public jury courts and a Pan-German parliament. However the movement failed as there was a lack of cohesion amongst political groups. The Prussian king Frederick William IV was offered to rule but he rejected the offer and therefore an imperial constitution could not be made. In the spring months of 1849 there were further clashes but the revolutionaries were put down. By June, the Baden Republic was ended by Prussia and Wurttemberg.
Although the 1848 attempt failed to unify the German states, they did establish future goals for democracy and unification. It also strengthened the 'lesser solution' and ended feudalism. However, many emigrated to the United States and monarch powers were consolidated.
Not only did the 1848 revolution damage Austria, but so did the war with France & Piedmont in 1859. Additionally, her empire included many religious and ethnic minorities particularly in Hungary. Austria's protectionist economy also did not result in a boom seen in the north under the zollverein ('customs union') that Prussia started. The Prussians, meanwhile, were strengthened following the Congress of Vienna as they gained more territory; they enjoyed ethnic and religious unity for the most part and underwent military reforms set out by the likes of Von Moltke. In 1850 the Prussians did attempt their own northern union (Erfurt) however succumbed to Austrian pressure to return to the Confederacy following the Olmutz agreement--a win for the Austrians.
Further down the pipeline after Bismarck rose to prominence in Prussia, the Seven Weeks War (1866) broke out with Austria over administration qualms in the northern territories gained after a war with Denmark (1865). Austria was utterly defeated at the Battle of Sadowa and the Treaty of Prague laid out the terms for a new North German Confederacy under Prussia. Austria was not allowed to join in any German organisation thereby effectively ending any involvement for a 'greater solution' of unification.
In conclusion, the Congress of Vienna pitted Austria and Prussia against each other with neither seeking to collaborate. The conservative nature of the Austrian government meant that no effort was made from their part and it forced the end of any liberal attempts at unification. Prussia, with the zollverein, military reforms and greater hegemony, were much stronger than an Austria weakened by the 1848 revolution, war with France & Piedmont and the lack of reforms. The Seven Weeks War was well-timed for Prussia as it happened alongside the Italian unification wars. The 1848 revolution pushed for a 'lesser solution' that was established further in the 1866 Treaty of Prague.
I hope this helps.
Sources: The Wars of German Unification by Dennis Showalter
Place and Politics: Local Identity,Civic Culture and German Nationalism in North Germany during the Revolutionary Era by Katherine Aaslestad
Austria, Prussia and the Making of Germany: 1806-1871 by John Breuilly
Edit: Word choice and format