Here I am going to try to address some confusion about why Allegheny County is not going to begin counting 30,000+ ballots until tomorrow. People are going bonkers about this, or castigating hard-working employees on no sleep, and it is wrong. (thread)
The ballots in question require special attention. The vast majority -- up to 29,000 -- involve a situation where a vendor sent the wrong ballots to voters, and had to reissue new ballots with the correct races. The challenge there is now voters have 2 ballots, one w/wrong races.
So you have to give those ballots special scrutiny to make sure that a) people don't vote twice, and b) if they just send in the old one, they don't vote in races they aren't eligible for. So you can't just scan them with the rest.
Other ballots in the pot include those that don't scan for whatever reason -- it's like when the ATM won't process the amount of the check you want to deposit, so you have to bring it into the bank office itself.
When ballots require special scrutiny, the county records the vote through a return board whose members are sworn in for that purpose. The board reviews the results tallied up by election workers after polls close, but also addresses provisional ballots, military ballots, etc.