Depositing into an automated market maker means holding a formula-determined mix of two assets. As their relative price moves, the pool sells the rising asset and accumulates the falling one, leaving less value than holding both untouched.
The name is optimistic. The loss reverses only if the price ratio returns to where it started, and the wider the divergence the larger the gap: a fourfold move in one asset costs roughly twenty per cent against simply holding.
Trading fees are the compensation, so the question is whether they exceed the divergence over the period. Pools of two assets that track each other closely, such as two dollar stablecoins, have almost no divergence and therefore almost no impermanent loss.