A centralized crypto exchange is run by a third party, monitoring and facilitating transactions and securing assets. The exchange provides the necessary infrastructure for market participants to conduct transactions. These transactions are generally settled off-chain on a centralized server the exchange operates.
Furthermore, centralized exchanges are (mostly) regulated by financial authorities and have to operate under KYC and AML regulations to ensure their operations are legal.
A decentralized cryptocurrency exchange is not operated by a central authority but runs on a system of smart contracts that allows the exchange to function without centralized oversight. This makes decentralized exchanges permissionless, meaning anyone is free to join without requiring permission from the exchange.
Thus, decentralized exchanges have no KYC or AML regulation.
Decentralized exchanges also operate on-chain and have a different mechanism for matching and settling trades. Instead of trading against other market participants, your trades are matched by an automated market maker, a system providing liquidity for trading pairs of cryptocurrencies.
A CEX is faster and easier to use. Centralized exchanges offer a slick user experience with clean interfaces and are straightforward to sign up for and trade on. Although you have to pass KYC to use a CEX, users can choose from different deposit and withdrawal options like cryptocurrencies, credit cards, or wire transfers. Trades on CEXes are settled near-instantly, which contributes to the smooth user experience.
DEXes are clunkier, slower, and require more experience by the user to navigate them. You can trade only cryptocurrency pairs on decentralized exchanges, which means you have to obtain crypto elsewhere if you want to trade on a DEX.