Crypto exchanges do not directly buy or sell cryptocurrencies. Rather, they create an enabling environment for traders to exchange tokens directly (decentralized) or act as middlemen (centralized) for transactions.
These crypto exchanges will make money through deposit fees, listing fees, commissions, spreads, or lending charges.