It's random. Nothing you can do about it except be helpful to the security staff who have to screen you (e.g. move over to the line with the body scanner rather than going through your normal line so someone doesn't have to escort you there after you've gone through the metal detector).