The movement of foreign exchange prices is based on multiple factors including demand & supply, economic factors (GDP, CPI, PPI), interest rates, inflation, politics. Since the economic growth and exports of a country are directly related, it is very natural for some currencies to heavily depend on commodity prices.
The economic growth of countries like Saudi Arabia, Russia, Iran (largest oil producing countries) is heavily dependent on the prices of crude oil (commodity). A couple of years back, when crude oil prices exceeded $100 per barrel, stock market and currency market responded very positively (strong currency) and then in 2016-17 when crude oil prices went down below $30 per barrel, financial market responded very negatively. The prices went down by 7% in a single day (stock market, extreme volatility), currency prices goes down. Since specifically few countries which are commodity exporting countries, economic growth is directly related to commodity prices. As we know, strong economic growth in a country means stronger its currency.
Specifically in case of dollar, there is an inverse relationship between the dollar prices and commodity prices. When the dollar strengthens against other major currencies, the commodity prices drops and when dollar weaken against other major currencies, the prices of commodities generally moves higher.
But why so??
The main reason is that the dollar is the underlying (benchmark) pricing mechanism for most commodities. The US dollar ($) is considered as the reserve currency of the world. As it is considered as the safe-haven currency ($), most countries hold dollars as reserve assets. In case of raw material trade (export/import), the dollar is the exchange mechanism for many countries if not all. When the dollar is weak, it costs more dollars to buy commodities. At the same time, it costs lesser amount to other country currency (JPY, EURO, INR) when dollar prices are down.
Generally Higher Interest rates lead to lower commodity prices. For example, if the RBI (India central bank) raises interest rates, that may reduce the level of economic activity and thereby lower commodity demand.
For countries like India, which is very large oil importer. Low oil prices is good for oil importing countries because when oil prices come down, inflation will cool down and with that interest rates will come down and that will increase economic growth.