How Decentralized Finance Works: Benefits, Applications, and Risks