A decentralized exchange, usually shortened to DEX, is a set of smart contracts that lets one digital asset be swapped for another without an operator taking the assets in. A subcommittee report to the CFTC's Technology Advisory Committee describes DEXs as software protocols that facilitate the automated exchange of digital assets, and identifies two services they can provide: an automated order book that matches buyers and sellers of a given pair, and a smart-contract-based automated market-making mechanism that pools reserves of each asset and executes trades against those reserves. The second design is the one most users meet, and it is what makes a DEX behave differently from any venue in traditional markets. The reports are advisory-committee subcommittee products and state that they do not necessarily reflect the views of the advisory committee, of the CFTC or its staff, or of the United States government.
How a DEX differs from a company-run crypto exchange in who holds the assets, and what that means for the risk of the venue failing, is covered on the crypto exchange page. This page is about how the venue itself prices and executes a trade.