I live in Allegheny County. It has ALWAYS been this way.
PA has closed primaries. The Democrats vote in the Democrat primary, and Republicans vote in the Republican primary.
The way it works is that you mail in your ballot and it gets delivered to the polling place where you would normally vote, still sealed in an envelope. At the end of the night when they run precinct totals those absentee ballots are opened and added to the totals.
They need to know whether a ballot is for the Democrat or GOP primary without opening it to keep the security of the system (which is actually pretty decent compared to some others out there).
Advantage is that your absentee ballot has to be physically at your polling place before voting starts or it isn’t counted. No Seattle “hey, look what I found in the trunk of this car!” scenarios.
That's ridiculous and completely void of any logic. If they need that to 'keep the security' of their system, then their system is a complete joke.
But before it gets from the voter to the polling place, the letter is handled by postal employees, most of whom are probably Democrats.