If an owner presses a button and the remote is too far away for the receiver to intercept the signal, the remote creates a new rolling code but the receiver does not. To avoid an owner locking himself out of his own car or garage if he accidentally hits the button from too far away, the remote and receiver are both designed to generate 256 random new codes each time a code is used. If the remote transmits one out of these 256 rolling codes to the receiver, it will still unlock the car and the two devices will sync back up and generate the same random codes because they both contain the same number generator designed to create the next set of 256 codes.
Though 256 codes may seem like a lot, it's virtually impossible to unlock another person's car, even if a person happens to have a remote designed to work with the same type of receiver found in that specific car. The chances of having a compatible remote and that remote generating one of the 256 codes the person's car will accept is still smaller than one in a billion. A thief would need years to find the right rolling code, making the rolling code system a fairly simple, yet reliable, method of safely locking and unlocking items using keyless entry devices.