Export-import, though the major, is not the only source for currency exchange.
Capital flow – Americans investing in Japan and Japanese investing in USA – is also a significant source of currency exchange.
In the process, RBI will have accumulated a pool of dollars; this is called forex reserve or foreign exchange reserve. Suppose Indian exports have dwindled, imports are on surge, foreign investors are fleeing Indian market and remittances are at all time low. Suppose US company wants to buy Indian textile and suppose on T-Shirt costs Rs. This records all the flow (into or out of the country) made for future return – investment in stocks, bond or companies, in real estate or FDI (investment made for setting up of business or industry).
Now, every one wants dollar but there is little supply. It also includes loans taken from abroad (which actually is investment by foreign lender into the nation).
But the American company will not have Yen, so it will purchase Yen from the international currency market.
This will increase the demand of Yen and supply of dollar.Notable exception is China which despite being large economy has its currency pegged to US dollar.But then when it comes to China, its irrational to talk about rationality : P. Bigger and developed economies like US, UK, Japan etc generally let market determine their exchange rate.In real world, there will be multilateral interactions and final exchange rate will be equilibrium reached by all those interactions. Most mid sized economy like India practices a mix of both these regimes.It allows for the exchange rate to float in a range which it deems comfortable.This type of exchange rate regime is maintained by generally smaller economies like Nepal and Bhutan (pegged to Indian Rupee) or several African nations.Rational behind such regime is that in case of small economy – if the exchange rate is market determined – the sudden influx or outflux of even relatively small amount of foreign capital will have large impact on exchange rate and cause instability to its economy.Thus the value of Yen vis a vis dollar will increase.Similarly if Japanese company is importing something from US, it will increase value of dollar as compared to Yen.In such economy exchange rate is determined by demand and supply of the currency.For example consider exchange rate of US dollar versus Japanese Yen.