lets assume a user has 1000 USDT that they want to swap for UNI token, let us further assume that the global price for USDT/UNI is 1 UNI per USDT.
The DEX aggregator will find the most optimal path and source the liquidity from various different DEX's.
Typically a swap fee of 0.5% is incurred on swaps and it is possible that the DEX aggregator takes a small fee also say 0.1%.
We can also assume the slippage is set to a default value of 0.5% and that the price impact of such a small trade is negligible (ie, 0%).
The gas cost can vary depending on which network is being used (ie, Ethereum or Arbitrum) and the congestion of the network at the time of execution. Lets assume the transaction is on Ethereum and incurs a $2 Gas cost. Although gas costs are usually priced in the native currency of the network (ie, in ETH), we can account for them in USD terms or any other token when trying to asses the real cost of our transaction. We can assume that the gas cost is equivalent to 2 UNI tokens based on the global USDT/UNI price. (Typically for such small swaps it makes more sense to execute on a Layer 2 like Arbitrum).
Lets assume that the DEX Aggregator applies the swap fees (0.6%) and price impact (0%), quoting 994 UNI for 1000 USDT . It is possible; but not guaranteed; that once executed the swap may also incur the slippage and result in the user receiving 989 UNI instead of 994 UNI.
If we account for the cost of gas; although the user will receive 989 UNI or 994 UNI; we can assume the real gas adjusted value of the swap is 987 UNI or 992 UNI depending on whether or not slippage was realised. What we can observe from this is that the real cost of the swap could be 1.3% or 0.8% more expensive than the global price.
If we assume a very large swap of say 1 million USDT, it is possible that such a swap may be too large (depending on which network it is being executed) in proportion to the available liquidity to generate a 0% price impact, making the real cost of the swap more expensive.