David Daley’s “Ratf**ked” examines the legacy of the REDMAP initiative. Illustration by Todd St. John

Sometime around October 20, 1788, Patrick Henry rode from his seventeen-hundred-acre farm in Prince Edward, Virginia, to a session of the General Assembly in Richmond. Henry is now famous for having declared, on the eve of the Revolution, “Give me liberty, or give me death!”—a phrase it’s doubtful that he ever uttered—but in the late seventeen-eighties he was best known as a leader of the Anti-Federalists. He and his faction had tried to sink the Constitution, only to be outmaneuvered by the likes of Alexander Hamilton and James Madison. When Henry arrived in the state capital, his adversaries assumed he would seek revenge. They just weren’t sure how.

“He appears to be involved in gloomy mystery,” one of them reported.

The Constitution had left it to state lawmakers to determine how elections should be held, and in Virginia the Anti-Federalists controlled the legislature. Knowing that his enemy Madison was planning a run for the House of Representatives, Henry set to work. First, he and his confederates resolved that Virginia’s congressmen would be elected from districts. (Several other states had chosen to elect their representatives on a statewide basis, a practice that persisted until Congress intervened, in 1842.) Next, they stipulated that each representative from Virginia would have to run from the district where he resided. Finally, they stuck in the shiv. They drew the Fifth District, around Madison’s home in the town of Orange, to include as many Anti-Federalists as possible.

An ally of Madison’s who attended the session in Richmond wrote to him that while it was unusual for the legislature to “bend its utmost efforts” against a single individual, this was, indeed, what had happened: “The object of the majority of today has been to prevent yr. Election in the house of Representatives.” Another friend reported, “The Counties annexed to yours are arranged so, as to render your Election, I fear, extremely doubtful.” George Washington, too, was pessimistic; Madison’s defeat seemed to him “not at all improbable.”

Henry’s maneuver represents the first instance of congressional gerrymandering, which is impressive considering that Congress did not yet exist. (One of his biographers has observed that Henry was fortunate that “the wits of Virginia” weren’t quick enough to invent the word “henrymandering.”) Since then, every party out of power has railed against the tactic. Meanwhile, every party in power has deployed it. The Federalists, when they got their turn, gerrymandered just as energetically as the Anti-Federalists. So did the Whigs, the Democrats, and, once the Whigs collapsed, the Republicans. In the eighteen-thirties, the Anti-Masonic Party briefly came to power in Pennsylvania. The Party used its hour upon the stage to push through a round of gerrymandering.

In contrast to our union, gerrymandering actually has grown more perfect with time. Henry had only his gut to go on, and his gut, it turned out, wasn’t that reliable. In spite of his machinations, the Fifth District elected Madison. Today, when party functionaries draw district lines, they have at their disposal detailed census results, precinct-level voter tallies, and a cloud’s worth of consumer choices. The result, David Daley argues in “Ratf**ked: The True Story Behind the Secret Plan to Steal America’s Democracy” (Liveright), is a system so rigged that it hardly matters anymore who’s running for office.

Much of “Ratf**ked” is devoted to a Republican scheme optimistically called REDMAP, for Redistricting Majority Project. REDMAP was created in early 2010, at a point when the country’s electoral map was largely blue. In twenty-seven states, Democrats held the majority of seats in both houses of the legislature, and in six more they held a majority in one house. The Presidency, the U.S. Senate, and the House of Representatives were all in Democratic hands. To describe their own party, Republicans were using words like “wounded” and “adrift.”

And, as bad as things looked at the time, the G.O.P.’s prospects down the road looked even worse. In 2011, new census figures were due to be released, and this would trigger a round of redistricting. Republicans, Daley writes, were facing “a looming demographic disaster.”

The idea behind REDMAP was to hit the Democrats at their weakest point. In several state legislatures, Democratic majorities were thin. If the Republicans commissioned polls, brought in high-powered consultants, and flooded out-of-the-way districts with ads, it might be possible to flip enough seats to take charge of them. Then, when it came time to draw the new lines, the G.O.P. would be in control.

“People call us a vast right-wing conspiracy,” Karl Rove told potential donors to the project at an early fund-raiser in Dallas. “But we’re really a half-assed right-wing conspiracy. Now it’s time to get serious.”

Daley conveys what happened next through the example of David Levdansky, a member of the Pennsylvania House of Representatives. Levdansky, a Democrat, had served in Harrisburg for thirteen terms. He was running for a fourteenth in a picnics-and-handshakes sort of way when flyers with out-of-state postmarks started landing in his constituents’ mailboxes.

“Stop David Levdansky from increasing taxes by a billion dollars again,” one declared.

“David Levdansky voted to waste $600 million taxpayer dollars and build an Arlen Specter library,” a second announced.

“$600 million down the toilet just to honor Arlen Specter,” a third flyer lamented. (Specter, then the state’s senior U.S. senator, had recently switched his party affiliation from Republican to Democratic.)

Between mid-October and early November, prospective voters in Levdansky’s district, south of Pittsburgh, received something like two dozen pieces of negative mail. The mail campaign was reinforced by equally negative cable-TV ads.

Levdansky tried to explain that the information in the flyers was false. The appropriation he’d voted for was to help finance a new library at Philadelphia University, and it amounted to just two million dollars. But the truth was no match for REDMAP. Levdansky lost his seat by a hundred and fifty-one votes.

“The fucking Arlen Specter library,” he tells Daley.

Others who found themselves in REDMAP’s crosshairs met similar fates. Daley, a journalist who now edits the Web site Salon, goes to interview a second former Pennsylvania representative named David Kessler. The two meet in a pizza parlor near Reading.

“I could have been running against that saltshaker and I would have lost,” Kessler says. “Because it all came down to those mailers.” One flyer sent to Kessler’s constituents likened the “$600 million” Arlen Specter library to the Taj Mahal.

This pattern was repeated in normally sleepy legislative districts from North Carolina to Oregon. All told, in 2010 Republicans gained nearly seven hundred state legislative seats, which, as a report from REDMAP crowed, was a larger increase “than either party has seen in modern history.” The wins were sufficient to push twenty chambers from a Democratic to a Republican majority. Most significantly, they gave the G.O.P. control over both houses of the legislature in twenty-five states. (One was Pennsylvania.) The blue map was now red.

Two of the most common gerrymandering techniques are “packing” and “cracking.” In the first, the party in charge of redistricting tries to “pack” voters from the rival party into as few districts as possible, to minimize the number of seats the opposition is likely to win. In the second, blocs of opposition voters are parcelled out among several districts, to achieve the same goal.