A flexible exchange rate helps to fix a trade deficit because it makes the currency of a country that has a trade deficit get weaker. This allows that country to export more goods and services.
When there is a flexible exchange rate, the exchange rate between two countries’ currency is determined by the forces of supply and demand. When there is greater demand for a country’s currency, it gets stronger. If there is less demand for a currency, it gets weaker.
When a country has a trade deficit, there is relatively little demand for its currency. Relatively fewer firms are buying its currency in order to use that currency to buy goods from that country. This makes the value of the currency go down.
Once the country’s currency gets weaker, its exports become cheaper. This is because its currency costs less. Therefore, firms in foreign countries can buy its currency more easily and can use that currency to buy the country’s exports. When this happens, the country is able to do more exporting and its trade deficit is reduced.
Thus, a flexible exchange rate allows a country’s currency to get weaker when it has a trade deficit. This allows the country to export more, thus closing the deficit.
A flexible (or floating) exchange rate refers to one that is allowed to change with the demand and supply of the currency in the market with little or no interference by the central banks to maintain a particular exchange rate.
If a nation is a net importer (or one that has a trade deficit), it has to buy currencies of the nations it is importing the products or services from as they have to be paid for in the currency of the nation they are being imported from. This increases supply of the currency of the nation with the trade deficit and conversely increases demand of the currencies of the nations it is importing from. This leads to a fall in value or depreciation of the importing nation's currency. As a result the products being imported are costlier to buy and their price in the trade-deficit nation increases. An increase in price leads to a decrease in demand of the imported products and subsequently a smaller number of units need to be imported. As a result, over time the trade deficit is reduced.