Currency swap involves exchanging the principal and fixed rate interest payment on that principal in one currency for the same principal and fixed rate interest payment on that principal in some other currency. It also helps companies to gain the comparative advantage by swapping the same principal and interest payment between the parties.
This can be explained by the below example
An US company can borrow money in USD at 5% interest rate, while for foreign company the interest rate is 6%.
An Indian company can borrow money in INR at 10% interest rate, while for foreign company the interest rate is 11%. The differential interest rate because of more credibility of a company inside the country.
Now suppose the US Company wants Rs 50,000 loan in India at 10% rate and the Indian company wants USD 1,000 loan in US at 5%. (USD : INR = 1 : 50)
Now the Indian company will borrow INR 50,000 at 10% rate and the US Company will borrow USD 1,000 at 5% rate. After that they will go for currency swap agreement.
After Swap, they will first swap the principal amount between themselves. After that the US Company will pay interest at 10% for INR 50,000 loan and the Indian company will pay interest at 5% for USD 1,000 loan.
Through this swap agreement, each company will get 1% benefit in the interest rate they will pay on the same principal amount.
This is how a currency swap can be used to reduce the effective rate of interest for any loan taken in the foreign country.