In Pennsylvania, independents don’t vote in the primary election; only those registered as Democrat or Republican may vote.
At the polls, Republicans get a ballot with Republican-only candidates; Democrats get only Democrat candidates. This way, the parties alone pick the candidate at the top of the ticket.