The pairing logic, in depth
Chocolate is the dessert that humbles wine, and the failure mode is always the same: people open a great dry red - a Cabernet, a Bordeaux - alongside a dark-chocolate dessert, and the wine tastes thin, sour, and stripped of fruit. The culprit is sweetness, or the lack of it. Our palate reads relative sweetness: put a dry wine next to a sweeter food and the wine's own fruit disappears, leaving only acid and tannin. The first law of chocolate pairing is therefore non-negotiable - the wine must be at least as sweet as what's on the plate.
That law is why fortified and sweet wines are the safest companions to chocolate. Port - especially with dark chocolate or a flourless cake - is the textbook pairing: it's sweet enough to never be overpowered, and its dark, dried-fruit intensity mirrors the cocoa. Banyuls (the French equivalent) and other sweet reds do the same job. If you only have still wine, the trick is to choose a dry red so ripe and fruit-saturated that it reads as nearly sweet - a jammy Zinfandel or a big Shiraz - which is the closest a non-sweet wine gets to surviving dark chocolate.
Match intensity, not just sweetness. Dark, bitter, high-percentage chocolate is powerful and wants a powerful, sweet, often fortified wine. Milk chocolate is sweeter but gentler and creamier, so it pairs down to a softer, fruitier, lightly sweet red. White chocolate isn't really chocolate at all in pairing terms - it's cocoa butter and sugar - so it abandons red entirely for an aromatic sweet white like Moscato or a late-harvest Riesling, whose floral sweetness flatters the vanilla and cream.
A few refinements make it sing. Chocolate desserts that include red fruit (a chocolate-cherry torte, raspberry ganache) tilt strongly toward jammy, dark-fruited reds that echo the berries. Salt in the dessert (salted caramel, a flaky-salt bar) makes a sweet red taste even rounder. And serve sweet reds and Ports just below room temperature, around 60-64°F - too warm and the sweetness turns heavy and alcoholic instead of lifted.