How providers earn
When you add liquidity you receive LP tokens representing your share of the pool. Each swap pays a fee, often 0.05% to 1%, which accrues to the pool. Some protocols also pay extra reward tokens to attract liquidity.
The catch
If the prices of the pooled tokens move apart, providers can end up with less value than if they had simply held the tokens. This is called impermanent loss. Pools can also be drained by smart contract bugs.