The intuition behind slippage is the following: if you try to buy big quantities in a market that has no liquidity, then you will have to pay more than the expected price (see this article for more details). Here we focus on the slippage occurring when swapping tokens on decentralised exchanges, that is when using liquidity pools.
So let us say that you want to swap BUSD tokens for WBNB tokens. For this you will use a BUSD-WBNB pool containing quantities and of both tokens before the swap. Recall from the swap formula that the real quantity of WBNB tokens you get from the pool is given by
where is the fee rate of the pool used to pay to liquidity providers (typically it equals 0.002). However for very small input of BUSD tokens compared to the sizes of the pools, we obtain an ouput of
The slippage of the transaction is the amount of WBNB tokens that you loose compared to buying all the WBNB tokens at the ideal price:
The result is quite intuitive: we see for instance that the bigger the quantity of BUSD you swap, the higher the slippage. Besides, the bigger the quantity of BUSD already in the pool, the less significative your contribution to this pool and the impact of your swap, and so the lower the slippage. Similarly, the bigger the quantity of WBNB already in the pool, or rather the bigger the pool ratio of a BUSD token expressed in WBNB, the more WBNB tokens are withdrawn from the pool because of your swap, and so the higher the slippage.