This study examines voting in the 2022 United States congressional elections, contests that were widely expected to produce a sizable defeat for Democratic candidates for largely economic reasons. Based on a representative national probability sample of voters interviewed in both 2020 and 2022, individuals who changed their vote from one party's congressional candidate to another party’s candidate did not do so in response to the salience of inflation or declining economic conditions. Instead, we find strong evidence that views on abortion were central to shifting votes in the midterm elections. Americans who favored (opposed) legal abortions were more likely to shift from voting for Republican (Democratic) candidates in 2020 to Democratic (Republican) candidates in 2022. Since a larger number of Americans supported than opposed legal abortions, the combination of these shifts ultimately improved the electoral prospects of Democratic candidates. New voters were especially likely to weigh abortion views heavily in their vote-shifting calculus. Likewise, those respondents whose confidence in the US Supreme Court declined from 2020 to 2022 were more likely to shift from voting for Republican to Democratic congressional candidates. We provide direct empirical evidence that changes in support for the Supreme Court, a nonpartisan branch of the federal government, are implicated in partisan voting behavior in another branch of government. We explore the implications of these findings for prevalent assumptions about how economic conditions influence voting, as well as for the relationship between the judiciary and electoral politics.