Some decentralised exchanges rely on liquidity pools to provide a liquid market for a given pair of tokens. This works by depositing the two assets into a liquidity pool of a DEX protocol at a specific ratio (most commonly with the value of the assets being equal). Then, any user can trade the pair directly from the pool, by swapping one asset for the other.
Unlike the order book model, the price isn’t determined by bid and ask orders, but rather automatically responds to supply and demand via a smart contract known as an Automated Market Maker (AMM). The simplest AMM is the constant product model, which is used by Uniswap, and which regulates the price by keeping the mathematical product of the amounts of the two assets constant. Therefore, when there is heavy demand for one asset, its price automatically increases in order to make sure the product remains the same. Furthermore, the price always reflects the prices on other exchanges because of arbitrage: as soon as there is a discrepancy, arbitrageurs (often automated programs) will step in and make a profit on the difference between the two exchanges, driving the price to the prevailing market level.