Why do electrical devices use such small wire?
Circuit wire is kept relatively large because general purpose receptacles are just that: general purpose.  You can plug a nightlight into them one moment and a kilowatt hairdryer the next.

In a fixture, luminaire, or appliance, on the other hand, the designers can use thinner wire (down to 18AWG for fixture wire as per NEC 402.6) as they know how much current will ever flow through there -- the appliance or fixture only needs a certain amount of current, never more (unless there's a fault, which is why you have fuses in appliances).