A swap is an agreement between two parties to exchange their cash flow streams, without liquidating the asset that generates those flows. The best example of a swap is applicable to the case of a floating rate housing loan. If you expect interest rates to go up in the near future, you could swap your floating rate loan for a fixed rate, without having to prepay your loan and take a fresh one. Even corporations with floating rate debt could swap their liabilities to a fixed rate obligation, without having to retire and reissue debt.
Swaps can be used either for hedging or for speculation, as the party to the contract who does not wish to bear the risk of an uncertain cash flow position swaps it with one who is able to take on this risk, in anticipation of returns. Currency and interest rates are popular underlyings for swaps.