The military neutrality of Switzerland has become legendary, and it is true that the country has not been involved in any outside conflicts since 1815. This does not mean, however, that the country has been completely unbiased or objective when it comes to wartime economics. It has been accused of aiding or abetting other countries, such as Germany, while still maintaining a veneer of neutrality.
Under a number of treaty agreements, neutral countries still have certain legal and moral obligations during wartime, and Switzerland has largely succeeded in meeting those obligations, although some have questioned the country's interpretation of neutrality.
Switzerland remains militarily neutral largely because the country itself is especially vulnerable to invasion from any one of its powerful neighbors, specifically France, Italy, Austria or Germany. Political neutrality for a small country with a limited military capacity is generally preferable to a hostile takeover from a belligerent neighbor. As long as the country is officially recognized as neutral, no country can legally form plans to invade it or use it as a base of operations. A neutral country can accept refugees or political prisoners, but it is not obligated to join peacekeeping missions after the conflict ends.
The country has not always been conflict-free, but most of its strife has been internal. Fighting between Catholic and Protestant factions during the 19th century did create major rifts in the Swiss government, but these matters were eventually defused internally. The government did not join Woodrow Wilson's proposed League of Nations until its official neutrality policy was recognized by all other members.
During World War I, Switzerland did not offer any meaningful military assistance to Germany or France, but other governments did not always respect the nation's borders or airspace. This fact did not escape the notice of the Swiss government, which made regular protests to both the League of Nations and its successor, the United Nations.
The country's policies and practices during World War II, however, did raise a number of concerns about its neutrality among Allied countries. Nazi Germany did maintain an economic relationship with Switzerland throughout the entire war. Swiss bankers were distressingly willing to establish secret accounts for Nazi officers seeking safe storage of money and other valuables looted from countries overtaken by the German war machine. While Swiss diplomats also provided safe passage for victims of Nazi oppression, the government often came perilously close to appearing politically allied with Germany.
Some historians suggest that the nation's eagerness to work with Nazi Germany and their caches of money and artworks helped to prolong the war itself. The German war machine was on the losing end of the conflict militarily several times, but influxes of cash and other support from ostensibly neutral Swiss banks helped Nazi Germany regain its footing and continue fighting the war. Formal accusations of Swiss financial assistance and political empathy towards Nazi Germany have been leveled several times over the years, but to date, the country has never charged with violating its own neutrality policy.