In some sense, yield farming can be paralleled with staking. However, there’s a lot of complexity going on in the background. In many cases, it works with users called liquidity providers (LP) that add funds to liquidity pools. Liquidity pool is basically the smart contract that contains funds. In return for providing liquidity to the pool, LPs get a reward. That reward may come from fees generated by the underlying DeFi platform, or some other source.