The foreign exchange market, often referred to as forex, is the market for the various currencies of the world. It is a market which, at its core, is rooted in global trade. Goods and services are exchanged 24 hours a day all over the world. Those transactions done across national borders require payments in non-domestic currencies.
For example, a US company purchases widgets from a Mexican company. To do the transaction, one of two things is going to happen. The US firm may, depending on the contract terms, make payment in Mexican Pesos. That would require a conversion of Dollars in to Pesos to make payment. Alternately, the payment could be made in Dollars, in which case the Mexican company would then exchange the Dollars for Pesos on their end. Either way, there is going to be some transaction which takes Dollars and swaps them for Pesos.
That is where the forex market comes in. Transactions like that take place all the time. The market maintains a rate of exchange between the US Dollar and the Mexican Peso (and between and amongst all other world currencies) to facilitate that activity. Consider the amount of global trade which takes place and you can see why the forex market is the biggest in the world, dwarfing all others. Literally trillions of dollars worth of forex transactions take place each and every day.