I thought Prussia and Austria were rivals? Why did they become allies?
If you are referring to the late 19th, early 20th century alliance: For starters you will find that European history has many instances of former rivals turned allies, especially during this turbulent period, for instance it was during this era that France and Russia shared a far more unlikely alliance. While the German Empire and Austria-Hungary had no shortage of disagreements and problems, it was the looming threat of Russian expansion that ultimately drew the two together in 1879. This was right after Russia's success in the Russo-Turkish war that gave Russia a great deal more influence in the Balkans, a region Austria-Hungary considered to be hers alone. A conference was held in Berlin to settle the dispute but the damage had been done, it was clear that Russia had permanent plans for the Balkans and thus Austria's only hope to ensure her security in the region was in Germany, despite their disputes.
In what time period are you talking about here? The leadup to WWI?