Switzerland is a small country and it is surrounded by much large countries that could threaten it. If it sided with one, it would be invaded by another so declaring neutrality it continued to be the best meant to retain national security. Also most if its population speak German as a first language, but a significant population French and a fair number Italian (and Romansh being the fourth official language, but relatively few speakers as a first language)and represent a diversity that is not present in many other countries.
Switzerland first declared neutrality in 1525 after the Battle of Marignano in 1515 and the defeat to French and Venetian forces. An “eternal peace” was signed between France and Switzerland as a direct result of Marignano.
The French invaded Switzerland in 1798 and set up the Helvetic Republic, this was deeply unpopular with the majority of the citizens of Switzerland, so much so that when Austria and Russia invaded, the Swiss refused to fight on behalf of the Helvetic Republic (though I would note here that four Swiss regiments participated in Npoleons invasion of Russia in 1812). After much discussion between Napoleon and Swiss representatives, much autonomy was restored in 1803. After Napoleons initial abdication and exile to Elba, the Swiss re-established their independence and other European nations agreed to Switzerland’s neutrality.
Switzerland joined the League of Nations as a founding member in 1919, they began to take on more duties other member nations were expected to aid with in the ’20s which threatened their neutrality. In the ’30’s however they successfully negotiated an independent state one again.
During WW2 the Swiss military was in a state of mobilisation should Germany invade, but remained neutral once again, they did however receive refugees over the border from both sides and were noted to have shot down a number of Allied and Axis planes that strayed over the border. Controversially the Swiss bankers of the time aided the Germans with financial exchange and/or storage of stolen good acquired during the holocaust and Swiss manufacturers were known to have aided the Axis powers with equipment.
Today, Switzerland officially remains a neutral nation for the same reasons it has always done so, despite involvement with multilateral institutions. Switzerland joined the United Nations in 2002.
Switzerland – always neutral, always helping scumbags hide their ill-gotten earnings.