Several years ago, I read about how sponsors/JA's handle snail mail.
Each envelope received gets assigned a number which is inputted into the computer. The envelopes are filed away in order unopened. When it's time to pick a winner, the computer randomizes for the winner, a number comes up, that envelope with that number gets pulled, and then it's opened to get the winner's information. When entries also include online entries, the numbers are entered into the computer along with the online entries.
On smaller and/or local sweepstakes, they may have a different system for doing this.