Liquidity pools use algorithms called Automated Market Makers (AMM) to provide constant liquidity for trading. They are used to facilitate trading by providing liquidity and are extensively used by DEXes (Decentralized Exchanges)
A single liquidity pool holds a pair of tokens and each pool creates a new market for that particular pair of tokens. The first depositor to the pool or liquidity provider sets the initial price of assets in the pool. Liquidity providers are incentivized to supply an equal value of both tokens to the pool. They receive special tokens called LP tokens in proportion to their contribution to the pool. When a trade occurs, a fee is collected and distributed proportionally to all LP token holders, and that fee changes from DEX to DEX.
When a token swap occurs through a pool, the supply of an asset decreases while that of the other increases. Therefore, price changes occur that are adjusted by that algorithm called an automated market maker (AMM) discussed before. This is the time where liquidity pools play their best role as they do not need a professional, centralized market maker to manage the prices of assets. Liquidity providers simply deposit their assets into the pool and the smart contract takes care of the pricing.