The German decision to invade Denmark and Norway in early April, 1940, immediately deprived Sweden of direct maritime access to the North Sea. Under its well-loved and respected Royal Family, King Gustav continued to play his daily game of tennis, but he and his government well-realised that it's neutrality lay firmly in its own hands. Sweden immediately began to convert itself into a country that could protect itself and its neutrality and to convert its economy to one based on production of war materials, to be sold to the highest bidder.
But as was the case with Switzerland, the German High Command decided against an overt occupation by its armed forces. This was for the same basic reason of paying the cost of containing an active resistance by citizens waging a guerrilla war and pinning down crack German troops.
Its SKF ball bearing products were internationally known and respected as indeed were its famous Bofors 44mm anti-aircraft gun. Saab immediately turned to the production of tanks and cars as well as aircraft. They also started to produce their own chemicals and turned to the forests to make all manner of products that could be turned into war materials.
Part of its large fleet of trans-Atlantic fleet of passenger liners was leased to the then-neutral USA and its own navy was considerably expanded.
Both Sweden and Switzerland were adept at the diplomatic game. Their diplomatic efforts were mainly responsible for preserving their neutrality.
The acme of diplomatic success over military prowess is dramatically underscored by the epic Raoul Wallenberg case saving the lives of up to 100,000 Jews. Arriving in recently-occupied Hungary in 1944, Wallenberg was diplomatic credentials but instructed to work on his own. His work however ended when Russian "liberators" took control of Hungary from the Germans. The Russian political agenda held no place for Wallenberg's humanitarian endeavours. He was last seen being escorted to Red Army Headquarters in Budapest from which he never returned. Despite Russian claims that he died in 1947, his ultimate fate remains unclear despite the strong international publicity his case attracted.