I think when a mail-ballot is returned, the voter who sent in the ballot has their record flagged in the voter registration database as having voted. The voter’s party identification is in their voter record, so it’s easy to tally Dems, Indies, Republicans that have voted.
Also, if you vote early or absentee, many states let you check online to make sure your ballot has been received and deemed valid.
Ok, that makes sense