This paper develops a search theory of labor unions in which the possibility of unionization distorts the behavior of nonunion firms. In the model, unions arise endogenously through a majority election within firms. As union wages are set through a collective bargaining process, unionization compresses wages and lowers profits. To prevent unionization, nonunion firms over-hire high-skill workers—who vote against the union—and under-hire low-skill workers— who vote in its favor. As a consequence of this distortion in hiring, firms that are threatened by unionization hire fewer workers, produce less and pay a more concentrated distribution of wages. In the calibrated economy, the threat of unionization has a significant negative impact on aggregate output, but it also reduces wage inequality.