When you put your tokens into a Uniswap pool, you get a proportional share of all the fees that other people pay to swap in that pool. It's not a fixed return: it depends on the total volume, your pool percentage (how much you deposited relative to the total), and the fee tier you chose (0.01%, 0.05%, 0.30%, or 1%). If the pool is dead, you earn almost nothing; if it's busy and you've got a decent chunk, you start seeing something.
The calculation isn't complicated in theory: (total pool fees) × (your ownership percentage) = your earnings. In practice though, there's the impermanent loss problem, which is the real risk. If the two tokens you deposited change price differently from each other, when you withdraw your funds you could end up with less value than you would've had just holding the tokens in your wallet. Let me explain: you deposit 1 ETH and 1000 USDC when they're worth the same thing. If ETH goes to 2000 USDC the pool rebalances automatically, you end up with less ETH and more USDC. When you withdraw, the loss is real if ETH keeps going up.
It's worth doing if: the pool volume is high, the fee is right (usually 0.01% is enough for stablecoins, 0.30% or more for more volatile stuff), and the two assets don't diverge too much. If you put your money in and the pool dies, or a token crashes, you lose. Start small, keep an eye on the value in real time with tools like Zapper or Uniswap itself, and be careful with new or low-liquidity pools - they're riskier.