The 2020 presidential election could come down to envelopes.

The state Supreme Court in Pennsylvania, a critical battleground state that’s seen as increasingly likely to determine who wins the White House, last week ordered officials to throw out “naked ballots” — mail ballots that arrive without inner “secrecy envelopes.” Pennsylvania uses a two-envelope mail ballot system: A completed ballot goes into a “secrecy envelope” that has no identifying information, and then into a larger mailing envelope that the voter signs.

It’s unclear how many naked ballots there will be, because this is the first year any Pennsylvania voter can vote by mail, and most counties counted them in the June primary without tracking how many there were.

But Philadelphia’s top elections official warned Monday that the court’s ruling “is going to cause electoral chaos,” lead to tens of thousands of votes being thrown out, and put the state at the center of “significant postelection legal controversy, the likes of which we have not seen since Florida in 2000.”

The decision ordering them thrown out was part of a trio of rulings Thursday that, among other things, extended the deadline for voters to send mail ballots back, permitted the use of drop boxes for voters to return them, and removed the Green Party’s presidential ticket from the ballot.

Taken together, those rulings were seen as likely to give Democratic presidential nominee Joe Biden’s campaign a boost, since Democrats are expected to vote by mail in far greater number than Republicans this year.

But throwing out naked ballots could be costly for Biden, in a state President Donald Trump won by only about 44,000 votes in 2016, or less than 1%.

“While everyone is talking about the significance of extending the mail-ballot deadline, it is the naked ballot ruling that is going to cause electoral chaos,” Lisa Deeley, chair of the Philadelphia city commissioners, wrote in a letter to state legislative leaders urging them to change the law to allow the ballots to be counted.

Deeley warned there will likely be tens of thousands thrown out — maybe more than 100,000.

“As public servants, we owe it to all citizens to avoid this situation, and the likely chaos that would come with it,” Deeley wrote to Senate President Pro Tempore Joe Scarnati (R., Jefferson) and House Speaker Bryan Cutler (R., Lancaster).

The concern over naked ballots is just the latest point of confusion and contention in an campaign season filled with lawsuits and legislative wrangling, which have left the basic rules of the election up in the air even as counties begin to send voters mail ballots.

Here’s what you need to know.

What are naked ballots?

When counting mail ballots, elections officials first check the information on the mailing envelope to confirm the validity of the vote. Then the outer envelope is opened and the secrecy envelope containing the ballot is set aside.

From that point forward, the vote is anonymous.

Naked ballots are ones without those secrecy envelopes. Nothing else is necessarily improper with the ballots themselves or the mailing envelopes.

What was the court ruling?

The Trump campaign and other Republicans sued Pennsylvania in federal court over several election rules, including arguing that naked ballots should not be counted. The state Democratic Party filed a countersuit in state court.

The Pennsylvania Supreme Court ruled they should be thrown out under state law.

“It is clear that the legislature believed that an orderly canvass of mail-in ballots required the completion of two discrete steps before critical identifying information on the ballot could be revealed. The omission of a secrecy envelope defeats this intention,” wrote Justice Max Baer, a Democrat.

Thus, Baer wrote for the court, “we hold that the secrecy provision … is mandatory and the mail-in elector’s failure to comply with such requisite by enclosing the ballot in the secrecy envelope renders the ballot invalid.”

How many naked ballots will be thrown out in 2020?

It’s hard to say.

The Pennsylvania Department of State advised counties to accept naked ballots as valid and count them in this year’s June primary. Most counties did so without tracking them. So there’s no statewide estimate for how many naked ballots there were.

And before this year, Pennsylvania had a more restrictive absentee voting system: Only about 5% of votes were even cast by mail in previous elections. It’s hard to extrapolate from those elections to this year, when mail ballots may make up about half of the total votes cast. And many counties in the past simply accepted naked ballots, so they don’t show up in rejected ballot tallies.

“It’s hard to say how big a problem this is, because Pennsylvania’s public accounting for rejected ballots is pretty limited,” said Charles Stewart III, a political science professor at MIT who studies election administration and quantitative measures of election performance.

Pennsylvania’s overall rejection rate of mail ballots was less than 1% in 2016, “which is actually pretty low” for a state in which voters must provide a reason for voting by mail, Stewart said in an email. (No reason is needed starting this year).

“Therefore, it’s hard to believe that this is the type of issue that would loom large in the vote count,” Stewart said. “But, of course, I could be wrong, since we just don’t have the data to tell for sure.”

What is clear is that some number of voters will return their ballots without secrecy envelopes, and those ballots will be thrown out.

“There is no question this is going to happen, and it’s going to happen with a decent number of ballots, but I can’t tell you if it’s going to be a number of ballots that exceeds the margins or not,” said David Becker, head of the Center for Election Innovation and Research. “We’re all extrapolating based on no data, but this will happen, and it could happen to a significant percentage. That’s all we can really say.”

In last November’s municipal election — under the old absentee system — 197 out of 3,086 absentee ballots in Philadelphia lacked secrecy envelopes. That’s 6.4%, and Deeley said that number will be even higher this year. People who voted absentee under the old system — in a municipal general election in deeply Democratic Philadelphia — are more likely to be highly engaged voters. And people are more likely to make mistakes when using a voting method for the first time.

“For a lot of people, this is going to be their first experience voting by mail,” said Delaware County Councilwoman Christine Reuther. “They didn’t vote absentee, they didn’t vote in the primary, and this whole thing is going to seem really strange to them.”

About 5% of mail ballots returned in Mercer County, north of Pittsburgh, were thrown out in the primary for not having a secrecy envelope. Almost half of total rejected votes were naked ballots, making it the single largest reason for discounting votes.

“It’s a significant number based on the recent history of the closeness of elections in Pennsylvania,” said Jeff Greenburg, who stepped down as Mercer County’s elections director at the end of July to join the National Vote at Home Institute.

What happens next?

Now that the state Supreme Court has ruled against counting naked ballots, changing that would be up to the state legislature. That’s why Deeley wrote her letter to Harrisburg Republicans.

Kate Flessner, a spokesperson for Scarnati, said the GOP Senate leader “continues to work with his legislative colleagues to ensure the voting process in Pennsylvania complies with the law, and is fair, transparent and timely.”

A spokesperson for the Department of State said Gov. Tom Wolf’s administration “would support legislation requiring counties to count naked ballots,” under the principle of protecting the right to vote.

But the Republican-controlled legislature may have little interest in allowing naked ballots, and it’s unclear that Wolf, a Democrat, will be able to reach an agreement with Republican lawmakers.

The Department of State will “greatly increase” its voter education campaigning around using both envelopes, a spokesperson said, including on its website, on social media, in emails to voters, and through direct postal mailers in paid advertising campaigns.

“The General Assembly could fix it,” Greenburg said. But until that happens, elections officials and advocates will have to make naked ballots a central focus of voter education.

“At this point, Pennsylvania has to raise its game in voter outreach on that issue,” Greenburg said. “Just that issue alone is huge.”

-Cynthia Fernandez of Spotlight PA and staff writer Jonathan Tamari contributed to this article.