In reality, asking how Liechtenstein came to exist is a somewhat nonsensical question. This little slice of autonomy was born in a time when the large countries of today did not exist, when Central Europe was one big mix of small states that were theoretically ruled by the Holy Roman Empire but realistically by local wealthy families. One such family was the Counts of Hohenems, who found themselves a little on the bankrupt side at the end of the 18th century. To alleviate some of the financial issues, the family sold the Lordship of Schellenberg (1699) and the County of Vaduz (17127) to the House of Liechtenstein, who took their name from their home castle just outside Vienna. The new lords brought the two pieces of land together and created the Principality of Liechtenstein, established under the watchful eye of the Holy Roman Empire in 1719, becoming a sovereign state in 1806. In 1815, it joined the German Confederation, an association of German-speaking states in Central Europe that essentially replaced the Holy Roman Empire.
The Confederation was little more than a squabbling ground for Prussia and Austria, and the whole thing fell apart with the Austro-Prussian War of 1866. All of this led to the creation of a unified German state, yet Liechtenstein somehow managed to avoid the territory-hungry tentacles of the new state and the ever-desperate needs of Austria. How? Well, it remained closely tied to Austria, but the two had a good relationship — Austria saw no need to stifle Liechtenstein, and Liechtenstein had no reason to join Austria. Germany was too far away, and Liechtenstein wasn’t rich enough or important enough to necessitate any advances. Geography, poverty and being really friendly saved Liechtenstein’s bacon (or its autonomy, in this case).
Liechtenstein remained closely tied to Austria until World War I, when the devastation of war saw almost everything in the area completely bankrupted. The prospect of further issues with the Allies saw Liechtenstein turn its eyes to Switzerland instead, and the two have been inseparable ever since. Vaduz has independence in many ways, but the Principality finds itself working with Switzerland on the international stage. The two have a mutual defence pact, although Liechtenstein’s total lack of army doesn’t exactly give the Swiss much help there.
So why does Liechtenstein exist? The simple answer is that it was too insignificant and not troublesome enough for its bigger neighbours to deal with it. When time came for Austria and Germany to start annexing things there were bigger fish to fry, and the post-World War II world saw annexation fall well and truly out of fashion in the Western world. No one cared enough to swallow Liechtenstein, and Liechtenstein was more than capable of looking after itself. It stayed out of everyone’s business thus everyone stayed out of its business, and if that isn’t an inspiring tale then we don’t know what is.