Connecting Lights to a 12/2 20 Amp Circuit
The wiring for the circuit (cable or individual wires in conduit, through walls, etc.) needs to all be protected by the circuit breaker. Any/all of that wire could at some unpredictable time in the future be used to the full capacity of the circuit - i.e., 20 A - and so it needs to all be big enough to handle the load. You are only putting in very low-current LED lights, but someone in the future might say "Oh, a 20 Amp circuit! I don't need the lights so I'll bypass the lights (take out lights and splice properly in the junction boxes) and use the cable at the far end to power by 20A device." And then proceeds to wire up a 20A-rated device that pulls 16A continuously and overheats the 14 AWG wire.

The external wiring is different. The thin cord plugged in to power a device (lamp, tool, charger, whatever) is rated to handle the current needed by the device. Unless someone starts messing around with the device - e.g., taking the cord off to use it power something else - the cord should never have any current beyond the rated current for the device. If it has a short-circuit situation (== device failure) then the breaker should trip before any of the wiring burns up.

In addition, the external cord has air circulating around it. That is a bit different from a cable stuck in the wall. Related: Never use an extension cord while it is coiled up