A swap is a general term used in the field of finance that refers to an exchange of cash flows generated by two different assets which usually lie in the same category, in the case of relatively simple swaps. Swaps are created with the objective of increasing inflows or decreasing outflows, reducing the risk associated with long term financial obligations or to ensure that the inflows and outflows remain relatively constant over the duration for which the swap has been created. Some examples of swaps are interest-rate swaps, currency swaps, commodity swaps, equity swaps, credit default swaps, etc.
To see how a swap actually works, let's analyze a currency swap. Consider two multinational corporations A and B with a necessity to borrow funds for their subsidiaries located in the country that the other corporation is in. The two could create a currency swap and borrow funds for the other corporations' subsidiary in the country they are located in.
Usually loans are easier to get and have a lower rate of interest in the country that a corporation belongs to. Also as the loans are being taken in the currency required by the subsidiary both the parent corporations are saved from paying foreign exchange conversion charges and other charges that are usually levied by governments when funds enter or leave a country. The risk due to changes in exchange rate for both the entities is also reduced as the loans are to be repaid in the same currency they have been borrowed in.
For the creation of the currency swap the exchange rate that was prevailing when the loans were taken is considered as the nominal rate. The terms of the swap specify that each corporation has to pay the other for the interest accrued and the principle amount of the loan that has been taken on its behalf by the other. The actual payment made here is the net difference between the amounts that the two corporations are paying the banks from which the loans have been taken.
As explained earlier, both the corporations benefit from the swap that has been created between them and there is a reduced outflow for both of them.