At a shop I visit often, the receipt checking is random, triggered by some prediction algorithm based on your history and current cart contents when you swipe your membership card when you exit the store. You get selected once out of perhaps 20 to 50 visits.
As a bonus, you get a small candy bar or similar "sorry we bothered you" gift if the check does not find any errors.