How Do Liquidity Pools Work in Cryptocurrency?

Smart contracts power cryptocurrency liquidity pools, but understanding how they generate passive income requires diving deeper into their mechanics.