Germany grew out of the collection of states, cities, and sees which in tirn derived from the fiefdoms of the Germanic tribes in Roman times. Many of these tribes had elected kings, an early form of democracy. Many of these disparate territories, united by language and culture formed the umbrella of the Holy Roman Emperor; again an elected post but which became dynastic in times of one state's dominance. In medieval times there was a period of prosperity and growing trade such that it became the hub of Europe, fed by the Empires fertile dominions in Lombardy. The Thirty Years War was devestating. Vast swathes were denuded and, through famine, pillaging and the war, there was a significant drop in population. Napoleon started the process of combining states, numbering some 400 at the end of the 18th century, and the rise of 18th century Prussia and the diplomacy of Bismark led to the unification of Germany and the founding of the German Empire in 1871. Unfortunately this led to a period of 'catchup', militarily and industrially which saw the Franco-Prussian War and led to the Great War.
Austria began as a march, a borderland given to the Babenburgs to protect Bavaria from the Hungarians, in 976. Expansion occured in the 12th century but the line became extinct and the Habsburgs succeeded in 1278. The collection of provinces, still only duchies, emerged as a state and a power after 1438 when, with one exception, the Habsburgs were also Holy Roman Emperors. In the late 15th and 16th centuries their dominions were vastly expanded, principally through marriage, to include the Netherlands, great chunks of Italy and Spain and the New World. Charles V left the Hereditary lands to his brother and Austria reverted back to its Central European origins. Almost continual war with the Ottomans saw the expansion of Austria through the Balkans and, after Napoleon, into Italy. The leadership of Metternich led the Austro-Hungarian Empire to its apogee. Militarily the country never excelled against the Western powers and the diversity of its people ultimately caused the collapse of the vast domains.