Wisdom of crowds happens when participants are motivated to find a "correct" answer. The classic example is counting jelly beans in a jar - where the average of guesses outperforms individual guesses. More practical applications include forecasting and prediction markets. In such contexts, aggregated forecasts / predictions outperform individuals (see Philip Tetlock's research for example). Presumably, democracy falls under this premise (with some evidence to support it), as do stock markets. Note that in this context, participants often do not make their individual decisions in group settings.
Group polarization in contrast, happens when participants are not motivated to find a correct answer. Rather, when individuals are motivated to reach group consensus, protect or build status, or satisfy some other agenda, then there is a tendency for opinions to polarize. This is common in debates (where participants are motivated to "win") and decision by committee (where the motivation is consensus). Presumably, arguments in court fall under this premise, as do parliaments. Note that in this context, participants do make their individual decisions in group settings.
Although aggregate results when participants are properly motivated tend to outperform those of badly motivated groups, this is not an inevitable outcome, and a paper by Mercier & Sperber (2011) argues that "argument" is adaptive, and can improve group decision-making under some circumstances, despite the tendency to polarize.