OKX DEX falls victim to exploit: $2.7 million stolen

How do decentralized exchanges (DEX) work?