How do electoral institutions affect primary competition and legislative behavior? This paper examines the understudied electoral rule known as ballot access laws, advancing the novel theory that denying ballot access to minor candidates forces these outsiders into major parties. I find that in American states that adopt high ballot access thresholds experience higher rates of ideological heterogeneity and primary competition, and those that reduce their thresholds experience a reduction in heterogeneity and competition. Using an original dataset on state-level changes to ballot access thresholds from 1990 to 2018, I find that an increase in the number and type of primary competition leads to an increase in heterogeneity within both party caucuses. This paper adds to the literature on legislative behavior and electoral institutions, demonstrating institutions role in shaping electoral competition and the ideology of those represented in office.