None of those guidelines were followed when the legislature last drew district maps in 2011 and 2017.

Precisely what Mr. Hofeller’s files contain remains a mystery. But one brief submitted by Mr. Oldham’s lawyers does not mince words about their sensitivity. Among them, the lawyers said, are legal analyses, strategy manuals prepared for national and state Republican officials, “an accumulation of highly honed redistricting maps” and written exchanges with party officials.

At issue are four hard drives and 18 thumb drives, comprising years of backups of Mr. Hofeller’s computer, that came to public attention only by the oddest of coincidences. Stephanie Hofeller, Mr. Hofeller’s estranged daughter, found the drives while visiting her mother after the strategist’s death in August 2018. While searching for a lawyer to handle estate issues, Ms. Hofeller mentioned the backups in passing to an official at Common Cause North Carolina.

The state’s Republican leaders have excoriated Ms. Hofeller over her actions. “Dr. Hofeller, of course, would not have willingly handed all his files to his political and legal opponents,” they wrote in a brief. “Most of the documents were not Mrs. Hofeller’s to give. Dr. Hofeller created and possessed them as an agent for his clients, so even he lacked the authority to turn them over without their authorization.”

Lawyers for Common Cause subpoenaed the backups early this year and discovered political bombshells: Documents in the North Carolina gerrymandering lawsuit appeared to indicate that Republican leaders had lied to a federal court in 2017 about their reliance on racial demographics to create the legislative map that was invalidated on Tuesday. (The leaders have denied the accusations; the state court called their explanation “not credible.”)

Other documents tied Mr. Hofeller directly to the Trump administration’s plan to add a citizenship question to the 2020 census, and offered a potential motive: reducing the population count in predominantly Democratic areas with many noncitizens, and thus increasing Republican representation. The Supreme Court rejected the citizenship question in June.

Republican figures have been fighting to keep the Hofeller backups confidential since spring, but the effort gained steam in July, when lawyers for Mr. Oldham asked the court to seal the backups to stop plaintiffs in the gerrymandering lawsuit from “continuing to publish Geographic Strategies’ confidential trade secrets to the world.” (In practice, lawyers in the gerrymandering case disclosed only a few of Hofeller documents during that trial and in the census lawsuit.)