Redistricting
Every ten years, states redraw the district lines that decide which voters pick which member of Congress. Whoever holds that pen can make a seat safe, competitive, or nearly unwinnable — before a single vote is cast.
More detail
Redistricting follows the census. In most states the legislature draws the maps; a growing number use independent or bipartisan commissions. “Gerrymandering” means drawing those lines to favor one side — “packing” opposing voters into a few districts or “cracking” them across many so they never form a majority. Courts can strike maps for racial discrimination, but partisan gerrymandering is largely left to the states. The practical result: in many districts the primary, not the general election, is where the real contest happens.