Over the past 50 years, the U.S. and several European labor markets have undergone two most incisive developments: job market polarization and deunionization. In this paper, we argue that routine-biased technical change is not only the driving force behind polarization, as prevalently assumed, but that routine-biased technical change is the common driving force behind both deunionization and polarization. In a search and matching framework with endogenous occupational and endogenous union membership choices, we show that the shift in employment and income shares in favor of high-skill and low-skill occupations worsens the bargaining position of unions, which crucially depends on the occupational structure inside a firm. This directly affects the membership choice of workers, who base their decision on the potential union wage premium. The ensuing deunionization provides further incentives for middle-wage workers to switch occupations and thus amplifies both job market polarization and the increasing income inequality.