The consensus seems to be that the gain is caused by the Bank of Japan raising rates on July 31, hinting at more raises. Yen has had historically low near-zero rates, so this raise strengthened their dollar.
On top of that, many traders were involved in a "Yen Carry Trade". Meaning they were borrowing Yen (because of the near-zero rates which beat out the 5% USD rates) and were using it to trade equities, crypto, whatever.
When the Yen started gaining against the dollar, these traders were actually losing money (since they were short Yen due to their Yen-denominated debt). This caused an unwind, meaning the traders wanted to close their positions (sell their equities, crypto, whatever) and buy back Yen to repay their debt, which pushed the Yen up further.
That, plus the trade was highly leveraged, so when yen rates went up the traders were asked to provide more margin. To meet the extra margin required they needed to unwind at least some of their position.
Not sure why, maybe it's because people are dumping USD, and buying Yen as a safe-haven currency?