As of Friday evening, Democratic Rep. Kyrsten Sinema had widened her lead on Republican Rep. Martha McSally in the exceedingly close Arizona Senate race — though counties across the state are still working their way through more than 300,000 ballots that have yet to be counted.

The Arizona secretary of state published an update for the closely watched Senate race on Friday — putting Sinema ahead by just over 20,000 votes. She had previously led by about 9,000 votes as of Thursday night.

Multiple counties are still tallying hundreds of thousands of outstanding ballots, so it’s very possible things will continue to change. The expansion of Sinema’s lead, however, seems to indicate that things are trending positively for Arizona Democrats as they try to take over retiring Sen. Jeff Flake’s open seat.

The new vote count is also remarkable in its own right: A large proportion of these votes come from Maricopa County, one of Arizona’s most populous areas and the home to cities like Phoenix and Scottsdale. They indicate that Sinema is on track to win the county — something a Democrat hasn’t done in about 30 years.

While the election took place on Tuesday, Arizona’s Senate race is taking much longer to call due to the high number of mail-in ballots the state has. About 75 percent of Arizonans vote via mail-in ballots, which need to be received by Election Day. (Unlike some other states, Arizona requires voters to have ballots physically in by this deadline and doesn’t count ones that are simply postmarked by that time.)

Once these votes are received, however, they undergo a rigorous — and famously slow — verification process. So it’s possible we won’t know the final outcome of the election until as late as next week.

Sinema and McSally were trading leads throughout Election Day, and have apparently continued to do since then. To complicate things even further, Green Party candidate Angela Green also picked up more than 46,000 votes as of Friday despite dropping out of the race and endorsing Sinema earlier this week.

If Sinema succeeds, this could be the first year that Arizona — which was a Republican stronghold but is becoming less so — elects a Democrat to the Senate in roughly three decades. Her win could be a crucial Democratic pickup and keep the Republican majority in the Senate narrow. As things stand, Republicans have been hanging on to their 51-seat advantage, and if McSally wins, they’re on track to expand it.

What happens with the outstanding mail-in ballots could really change everything.

How mail-in ballots work

Arizona is among the states that are heavily dependent on mail-in ballots, which enable residents to vote early or physically drop off their ballots at designated locations on Election Day. As Vox’s David Roberts has written, mail-in ballots are often way more convenient for voters who can make their decisions at home and simply send them in once they’re done. In a number of places where mail-in ballots are used, studies have found that they streamline the experience so much that they improve voter turnout.

Currently, 27 states use mail-in ballots to some capacity, and Washington, Colorado, and Oregon use them for all elections, according to the National Conference of State Legislatures. The downside of mail-in ballots is that they can take much longer to count compared to votes that are submitted the more traditional way on Election Day.

This issue is exactly what’s playing out in Arizona, and one that California has often had to deal with as well. As of Wednesday, there were still 600,000 mail-in ballots — of more than 2 million total ballots cast — that Arizona officials were waiting to process in places like Maricopa County.

Part of the reason processing mail-in ballots takes so long is that these votes need to be verified. One way officials do this is by making sure the signatures on the ballots match up with respective residents’ signatures on file. If they don’t, officials reach back out to voters to confirm the ballots’ authenticity.

Because some of the mail-in ballots don’t arrive until very close to Election Day, this verification process can take place afterward and make tabulating the votes much, much slower.

This process, in addition to delaying when results are announced, also became the focus of a Republican lawsuit. The Republican parties of four Arizona counties had filed a suit against the Arizona secretary of state and all county recorders over how mail-in votes are verified, the Hill reported.

The GOP plaintiffs argued that various counties are verifying votes differently and note that the process should be more consistent. Some counties call voters after Election Day to verify their ballots, while others don’t, they said. They asked for an injunction so that all ballots verified after Election Day can be omitted from any final vote tally — and specifically called out multiple counties that are seen as Sinema strongholds. But late Thursday night, a federal judge rejected the lawsuit, allowing the count to move forward.

Maricopa County Recorder Adrian Fontes told the Arizona Republic that this kind of post-Election Day timing on verification is commonplace and not quite the anomaly that Republicans have framed it to be. It’s not apparent how many votes would have been withheld if a judge had sided with the Republicans, but it’s likely to have affected places that have been more left-leaning in the past.

As such, Democrats had slammed this suit as a last-ditch attempt at voter suppression, and one that went out of its way to target places that could have backed Sinema. “The Republican party is doing everything it can to silence thousands of Arizonans who already cast their ballots,” Arizona Democratic Party Chair Felecia Rotellini told the Hill.

Both Sinema and McSally are bullish about the results

Members of the Sinema camp have expressed confidence about the possible outcome of the election as results continue to roll in, while McSally’s seemed confident earlier in the week.

Democrats have long eyed Arizona as a possible Senate pickup. Given the number of votes that still need to be counted, it could be a few more days before we know whether they’ve managed to pull it off.