Slippage happens whenever the price a trader sees on screen isn't the price actually filled on-chain, and in crypto it is driven mainly by two forces: how the trade itself moves the market, and how much the market moves in the seconds between submitting and confirming an order.
On an automated market maker, a swap directly shifts the ratio of tokens held in a liquidity pool, so the trade's own size determines part of the slippage: the smaller the pool relative to the order, the larger the price moves before the swap fills. This is often called price impact, and it is separate from slippage caused simply by network latency, where a transaction sits in the mempool for several blocks while the broader market price drifts away from the original quote.
Most DEX interfaces let traders set a maximum slippage tolerance, a percentage buffer between the quoted and worst acceptable execution price. If the final price would fall outside that buffer, the transaction reverts rather than filling at a bad rate. A tight tolerance protects against poor prices but risks failed transactions on volatile assets; a loose tolerance nearly guarantees execution but can be exploited by bots running sandwich attacks, buying ahead of a pending trade and selling immediately after to capture the difference, a form of front running.
Slippage tends to be smallest on deep, high-volume pairs and largest on thinly traded tokens, making liquidity depth the single biggest factor in how much any given trade will cost beyond stated fees.