Such a feature makes liquidity providing extremely easy and basically spurred on the DeFi revolution because now every Joe or Jane can become a market maker, where in the past that job was reserved to big financial institutions.
The basis of Uniswap is the constant product formula, x * y = k, where x is the quantity of asset X, y is the quantity of asset Y and k is a constant. Each pool therefore only comprises of two assets X and Y and this formula ensures the ratio of both are equal.