Decentralized prediction markets such as Polymarket have rapidly gained traction in recent years. Here’s how they work.