As you start trading in the market, you may have noticed that you are provided two prices - an ‘ask’ (or ‘buy’) price and also an ‘bid’ (or ‘sell’) price. The ‘ask’ price is the rate at which you sell the base currency, and the ‘bid’ price is the rate at which you will buy the base currency. The difference between these two prices is referred to as the ‘spread’.
When you enter the market and open a trade, there are always third parties who facilitate the opening and closing of that trade, such as a banking institutions or liquidity providers. These intermediaries ensure there is an orderly flow of buy & sell orders, this means they are tasked with the responsibility of matching each seller to a buyer, & vice versa.
The third party is accepting the risk of a potential loss while facilitating the trade, thus the reason why the third party will retain a part of each trade transacted—that retained portion is what we understand as the ‘spread’.