Switzerland is presumably where one moves the money in case of an apocalypse; although, they have lost some of that appeal now with the tax reporting to the EU and USA.
Switzerland has a very old, stable banking industry, but this isn't the only appeal. Their reputation for safeguarding money, be it despot or Nazi, is most of the attraction. Low to no taxes is the second. Also, there isn't much financially illegal despite recent changes. Put that all together, and if a country is about to go to hell in handbasket because it borrowed too much or goes to war while Switzerland stays stable and very strict about paying depositors, those residents are going to try to move as much money to Switzerland as possible before its confiscated for one reason or another, sending the CHF up.
Japan is a different duck.
They have persistently ~0% inflation thus low nominal and real interest rates. With them, the so-called "cash & carry trade" or more ubiquitous "carry trade" dominates. Many investors choose to borrow in JPY to buy investments denominated in other currencies. If the countries of those other currencies are about to take their residents' money or go to war, putting money at jeopardy, the residents doing the carry trading will try to unwind their levered investments to reduce risk, sending the JPY up.