So the first xx% of votes are easy to count.
They've been done in person, gone straight into the machine, and have been tallied.
If you're in a state that is heavily Biden or heavily Trump, then you'll count all of those, and know that there aren't enough votes left to swing the election the other way, then you can declare the winner.
You'll still count the other votes but no one's paying any attention any more because they're not waiting for the results.
Then you get to the votes that are harder to count.
If you're in a state where it could go either way, now you need to start carefully counting all of those votes, and reporting the results.
Postal ballots come in an envelope. You open the envelope, check that the signature on the outside of the envelope matches the person's signature on the DMV rolls.
You check the address and DOB matches what you have on record. Generally you do a lot of checking.
Once you're happy the vote is from a registered voter who hasn't already voted another way, then you smooth out the ballot and it can be fed into a machine and counted.
If there's a problem with the process of going through the machine - eg the paper was damaged - then you have to transfer the results to a new ballot. You need several election watchers to watch you doing this to ensure you're not cheating. You can then put that sheet through the machine.
If some of the info on the ballot is wrong eg DOB put where it should have been today's date, then you will get in touch with the voter and give them time to come in and 'cure' their vote, ie fix any discrepancies.
Some voters will have been sent a postal ballot, but for some reason it wasn't accepted or they lost it or whatever, so instead they come in on Election Day to vote. If they don't have the right ID with them, then they're given a provisional ballot, which they can use to vote.
But that ballot still has to be checked to make sure that the person is really supposed to vote - so they are asked to come into the voting station with ID and anything else the election officials in that state need.
With those provisional ballots they also need to check that the person didn't vote another way eg in another polling station.
Then in some states they allow votes to be counted that arrive after Election Day, as long as the postmark shows that they were posted on or before Election Day. Different states have different deadlines eg Georgia (I think) was today.
Those ballots are important - they're from the military, and overseas voters. Usually they wouldn't matter all that much, but in a swing state they can make the difference.
On top of that, one county in Pennsylvania printed out a batch of ballots that were incorrect, and sent them out. Once they realised, they had to send out new ballots, which left people little time to return them.
On top of that you've got issues with people outside the polling place shouting and screaming, many of them armed.
You've got court cases resulting in random instructions that change on a daily basis.
You've got poll watchers wanting to watch every single thing you do, some of them filming you while you do it.
So... that's why the counting slows down the closer the count gets.