By providing liquidity to a pool (by contributing the pool's required tokens), you are earning a fee from all the trades (aka swaps), usually at 0.3% of the trade. This is based on your proportional ownership of the pool. However, the downside risk of providing liquidity is Impermanent Loss, which is the difference of the coins between entering into a liquidity pool position versus simply holding your coins in your wallet. As the allocation of the coins in a pool changes based on supply and demand, you can end up with more of the undesirable coin.