The tiny mountainous country of Switzerland has been in a state of “perpetual neutrality” since the major European powers of the time declared it as such during the Congress of Vienna after the end of the Napoleonic wars in 1815.
The French conquered Switzerland in 1798, establishing the Helvetic Republic in attempt to make Switzerland something of a strategically positioned French satellite state. Not long after, Austrian and Russian forces invaded the country in their war against France. The Swiss, rather than fighting alongside their French overlords, largely refused. This ultimately led to the Act of Mediation, giving the Swiss back much of their former independence. Twelve years later, they got the rest thanks to the aforementioned Congress of Vienna in which their neutrality in the wars of their neighbors was officially recognised.
Beyond the Swiss themselves having long tried to stay out of the conflicts of Europe (since the early 16th century after a devastating loss at the Battle of Marignano), part of the reason Switzerland was granted neutrality in perpetuity in 1815 is because the European powers of the time deemed that the country was ideally located to function as a “a valuable buffer zone between France and Austria.” Thus, granting their neutrality in wars, so long as they continued to stay out of them, would “contribute to stability in the region.”