I see a lot of misunderstanding of what it means when your “check engine light” (MIL: Malfunction indicator Lamp) is on and what the “codes” (DTC: Diagnostic Trouble Codes) mean. Let’s discuss this a bit in general terms that apply to most vehicles and situations. As with everything, there are always exceptions.
First of all, why does your MIL come on? It’s because the ECU has stored a “hard” DTC. This is an event which likely has happened many times and with sufficient severity that the DTC has gone from a “pending” state (which you can read with a code reader but does not illuminate the MIL) to a “hard” state.