For assets that are traded on exchange, such as shares, your broker will have access to each exchange's order book – the list of buyers and sellers currently placing orders.
The order book displays the price and size of each order, so it's easy to see where your order should be placed.
As well as the primary exchanges, such as the London Stock Exchange or the New York Stock Exchange, there are also a number of Multilateral Trading Facilities (MTFs) which accept orders and quote prices on certain stocks. They sometimes offer better prices than the primary exchanges, although not all brokers are able to access them.
Prices offered by primary exchanges and MTFs are publicly visible, and are known as lit books. However, prices hidden in dark liquidity pools can also be available for you to trade against, if your broker has access to them. Participants in dark pools are generally institutional investors who don't want to reveal the price, size and origin of their orders.
For OTC markets, such as forex, prices are sourced from the network of global banks and liquidity providers participating in the market.
Prices can change in a matter of milliseconds, and between the moment when you click to place an order and the point when your broker receives it, your intended price might become unavailable.
If you're using a market order, it will be executed at the best price your broker can get. This could be substantially worse than the price you expected if markets are volatile and moving rapidly – perhaps after a startling news event or unexpectedly poor company earnings report.
You're most likely to see the impact of slippage when you've left a stop-loss order to close a position in the event of an adverse market movement. Sometimes, prices may be changing so fast that it's impossible to close your trade at the level where you set your stop.
Say you take a long position on the Dow Jones Industrial Average index at 17,838 with a stop at 17,699.
A couple of influential Wall Street firms then report unexpectedly poor earnings. This causes a drop in other Dow constituent stocks, and the index tumbles through your stop. As soon as the price meets your stop level, your stop order is triggered.
Here's a table showing how the price quoted by your broker moves in the moments before and after your stop is hit:
You can see that the bid price reaches your chosen stop level of 17,699 at 21:10:33 (in blue). This is when your stop order is triggered, but it's executed at the next available price of 17,695 at 21:10:36 (in green). This means you have paid four points in slippage, but are protected from the rest of the price drop.
A guaranteed stop works in the same way as a standard stop-loss, except that it will always be filled at exactly the level you set. Effectively, the broker or trading provider takes on the risk of slippage for you. Naturally they may require a fee for this additional service, and this can come in the form of a wider spread.
Attaching a guaranteed stop puts an absolute limit on your potential loss, and this can be reassuring when you're trading in volatile markets or in large sizes.