U.S. state legislatures are critical policymaking bodies and the major pipeline of candidates to national office. Polarization in state legislatures has increased substantially in recent decades, yet we understand little about the role of elections in this process. We offer the first systematic study of state legislative candidate ideology across all election stages using a new dataset on primary- and general-election results for over 84,000 candidates, 1992-2020. We find that the pool of candidates has polarized substantially in recent decades amidst consistently low electoral competition. More-extreme candidates have enjoyed a modest advantage in contested primaries that has doubled in the past decade. More-moderate candidates previously enjoyed an advantage in contested general elections, but this has shrunk to nearly zero in the last decade. The results indicate a shifting equilibrium in which more-extreme candidates increasingly seek office, win primaries more often, lose general elections less often, and face limited competition.