If the X-ray suspects that there is something suspicious in the bag, it is rejected and the X-ray image is sent to a human screener. If this screener is unable to clear the bag, it is sent to secondary search where it is opened and inspected by a human (TSA Officer or other screening authority). It's that simple.