A worker loads a ballot into a machine at the Broward County Supervisor of Elections office during a recount on Tuesday, Nov. 13, 2018, in Lauderhill, Fla. (AP Photo/Brynn Anderson)

It’s been a week since Election Day, and we’re still awaiting results from Florida and Georgia, where nationally prominent races are too close to call.

Since Election Day, an additional 50,000 votes have been counted in Florida, narrowing the lead for Republican Gov. Rick Scott over Democrat Sen. Bill Nelson in the Senate race, and for Republican Ron DeSantis over Democrat Andrew Gillum in the gubernatorial contest. Both races are headed to a recount. In Georgia, nearly 150,000 votes have been added to the election night tally, cutting the lead of Republican Brian Kemp in half over Democrat Stacey Abrams in the contest for governor.  That contest, too, may be headed for a recount.

Across the country, in Arizona, a close-but-comfortable election night lead for Republican senatorial candidate Martha McSally was transformed a week later into a victory for her Democratic opponent, Kyrsten Sinema, as an additional 800,000 ballots were counted, and the results flipped.

This slow process of counting ballots has produced considerable controversy. But it shouldn’t. Both state laws and sheer logistics make it impossible to finish counting ballots on election night or even within a day or two. Here’s why that is — and why newly counted ballots seem to favor Democratic candidates.

Why the counting isn’t done on election night

The election night tradition of gathering around the television to see the votes come in and news organizations “call” the winners gives us a false impression: All the votes that need to be counted can, and should, be tallied in the minutes after  the close of polls.

But this is wrong. For one, in almost every state, provisional ballots will have been cast on Election Day by voters whose registration cannot be verified.  In 2016, 2.1 million voters cast a provisional ballot, 71 percent of which were eventually counted after the registration was verified. States are currently in the middle of verifying the registration status of those who cast provisional ballots in 2018, and decisions are being made about whether to count those ballots in this election. Moreover, millions of ballots have been mailed in, which now need to be opened, have voters’ signatures compared to the signature on record and then scanned.

In some states, this means that a large number of votes are counted after Election Day. In 2016, California and Washington counted less than half their votes within a day of the election. Three other states, Alaska, Arizona and Utah counted only about 60 percent. Another six states had counted only 90 percent of their ballots.

In Arizona, ballot-counting takes extra time because three-quarters of Arizona’s voters cast ballots by mail. Many of these are returned in person on Election Day. Processing mail ballots is labor-intensive and can take days if not weeks to complete. Arizona also has a relatively large percentage of provisional ballots — almost 4 percent of all ballots in 2016 — and those ballots must also be painstakingly processed.

In Florida, the situation is different. Florida actually tends to have a small number of ballots to be counted after Election Day. In 2016, nearly 98 percent of all ballots were counted on either Election Day or the day after. The same pattern is repeating in 2018. Most of Florida’s absentee ballots arrive before Election Day. State law allows counties to tally absentee ballots — and keep the results quarantined — which speeds up the count.

Florida law does prohibit its large number of early votes from being tabulated before the polls close on Election Day. However, it is clear that almost all counties have organized themselves in such a way that they can get the early-vote count completed within hours of the polls closing. Broward and Palm Beach Counties have not chosen to do this, but they are acting within the discretion given under Florida law.

Why do the newly counted ballots favor Democrats?

Since the 2000 presidential election, the post-election-night vote count has favored Democratic candidates in most states. This pattern was first identified by Ohio State University law professor Edward B. Foley, who called it the “blue shift.”

The blue shift was evident in 2016. On the Wednesday after Election Day, 124 million ballots had been counted, and Hillary Clinton led Donald Trump in the national popular vote by only 0.2 percentage points. But as an additional 13 million ballots were counted, Clinton’s lead widened to about 2 points. The blue shift happened in most states, as well — although Clinton’s lead in Washington state actually shrank by over 3 points as all the ballots were counted.

There are two reasons the blue shift exists and has become more prominent. First, the 2002 Help America Vote Act required states to institute provisional ballots for voters with a disputed registration status when they went to vote. Because voters who cast a provisional vote are more likely to be young and members of a racial or ethnic minority group, provisional ballots are disproportionately Democratic.

Second, Democrats are slightly more likely to vote by mail than Republicans. This is probably  because Democratic campaigns are more likely to emphasize turning out supporters before Election Day than are Republican campaigns. Thus as these mail ballots are counted, the overall total will again lean Democratic.

What’s happened in Florida and Arizona is nothing new. In fact, it’s entirely consistent with current trends in election law and election administration. Voters across the United States have demanded greater flexibility in how and when they cast their ballots. This greater flexibility comes with a price: a delay in counting ballots.

Of course, one must guard against shenanigans that could occur during the counting of these additional ballots.

But to date, nothing about the vote-counting in Arizona and Florida suggests that the growing number of votes or their Democratic tilt are due to electoral improprieties.

Charles Stewart III is the Kenan Sahin distinguished professor of political science at MIT and director of the MIT Election Data and Science Lab.