So just a nitpick, but the CEL is not
exclusively for emissions related codes. There are a wide range of things that can fail that do not affect the emissions output of the car, but will still trigger a code and light. All of them can fail you in an emissions test, but not all of them are emissions related.
Edit: All of them will fail you -> All of them can fail you. Not all codes will trigger an immediate fail in CA smog testing anyways, depending on if they are manufacturer specific, or what they effect. I passed my most recent smog with a few codes.