A CFD is an agreement between you and the broker to exchange the difference between a trade's opening and closing price. You never own the underlying asset — forex CFDs let you speculate on EUR/USD, stock CFDs let you speculate on Apple shares, commodity CFDs cover gold and oil — and you can go long or short with equal ease.
CFDs are popular because they are flexible, leveraged, and tax-efficient in some jurisdictions. They are also higher risk: most retail CFD traders lose money (brokers are required to disclose the loss percentage, usually around 70–85%), and the leverage that amplifies wins equally amplifies losses. CFDs are banned for US retail clients.