The vote counter checks that the ballot is for the Democrat. If so, it’s deemed valid.
That is it. Valid equals vote for Democrat.