A fixed exchange rate is usually used to stabilize the value of a currency, vis-a-vis the currency it is pegged to. This facilitates trade and investments between the two countries, and is especially useful for small economies where external trade forms a large part of their GDP.
It is also used as a means to control inflation. However, as the reference value rises and falls, so does the currency pegged to it. In addition, a fixed exchange rate prevents a government from using domestic monetary policy in order to achieve macroeconomic stability.
In certain situations, fixed exchange rates may be preferable for their greater stability. For example, the Asian financial crisis was improved by the fixed exchange rate of the Chinese renminbi, and the IMF and the World Bank now acknowledge that Malaysia's adoption of a peg to the US dollar in the aftermath of the same crisis was highly successful. Following the devastation of World War II, the Bretton Woods system allowed Western Europe to have fixed exchange rates until 1970 with the US dollar.
With regard to the Asian financial crisis, others argue that the fixed exchange rates (implemented well before the crisis) had become so immovable that it had masked valuable information needed for a market to function properly. That is, the currencies did not represent their true market value. This masking of information created volatility which encouraged speculators to "attack" the pegged currencies and as a response these countries attempted to defend their currency rather than allow it to devalue. These economists also believe that had these countries instituted floating exchange rates, as opposed to fixed exchange rates, they may very well have avoided the volatility that caused the Asian financial crisis in the first place. Countries like Malaysia adopted increased capital controls, believing that the volatility of capital was the result of technology and globalization, rather than fallacious macroeconomic policies. This resulted not in better stability and growth in the aftermath of the crisis, but sustained pain and stagnation.
Countries adopting a fixed exchange rate must exercise careful and strict adherence to policy imperatives, and keep a degree of confidence of the capital markets in the management of such a regime, or otherwise the peg can fail. Such was the case of Argentina, where unchecked state spending and international economic shocks disbalanced the system and ended up forcing an extremely damaging devaluation (see Argentine Currency Board, Argentine economic crisis, and the 1994 economic crisis in Mexico). On the opposite extreme, China's fixed exchange rate with the US dollar until 2005 led to China's rapid accumulation of foreign reserves, placing an appreciating pressure on the Chinese yuan.
Typically, a government wanting to maintain a fixed exchange rate does so by either buying or selling its own currency on the open market. This is one reason governments maintain reserves of foreign currencies. If the exchange rate drifts too far below the desired rate, the government buys its own currency off the market using its reserves. This places greater demand on the market and pushes up the price of the currency. If the exchange rate drifts too far above the desired rate, the opposite measures are taken.
Another, less used means of maintaining a fixed exchange rate is by simply making it illegal to trade currency at any other rate. This is difficult to enforce and often leads to a black market in foreign currency. Nonetheless, some countries are highly successful at using this method due to government monopolies over all money conversion. This is the method employed by the Chinese government to maintain a currency peg or tightly banded float against the US dollar. Throughout the 1990s, China was highly successful at maintaining a currency peg using a government monopoly over all currency conversion between the Yuan and other currencies.