its mostly supply and demand; if a bank that does currency conversions needs yen they contact a bank in japan and try to negotiate as many yen for their dollar as they can, while obviously the japanese bank does the opposite, until they meet in the middle. do note that central banks will have a variety of methods to adjust the supply and demand for different currencies, if they find the need too.
United States