system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What causes you to hear a high pitched noise when a device, which has been fully charged, is still in the charger?
gpt
Small chargers today are switch mode power supplies.

They work, simply said, by first rectifying the alternating mains current to direct current, then chopping it up again to pulses at a much higher frequency, transforming it down and rectifying it again. 

That sounds overcomplicated, but transformers for high frequencies are WAY smaller, cheaper and more efficient, which is worth the hassle.

The transformer tends to make a sound, just like the "normal" ones make that familiar hum. It's depending on quality, cheap ones tend to have loose parts which vibrate and make them louder .. but normally the used frequency is way beyond our hearing range, so it seems dead quiet. 

If the device is charging and needs less and less power to do that as the battery fills up, the power supply has to reduce the power it delivers to held the output voltage at the same level. This is done by making the pulses of the primary voltage shorter and shorter. 

If the device is fully charged and in standby, it needs almost no power, but there is a lower limit how short the pulses can be, so the only choice the charger has is to drop (e.g., very simplfied) every 5th pulse completely or the output voltage would climb too high.

But THAT introduces an additional frequency component at (in that case 1/5th) the normal switching frequency, which you can hear. Since the amout of dropped pulses is varying much with load, the sound tends to be quite irregulary and if you pick it your device to use it, while still connected to the charger, you can often even "hear" the fluctuating current consumption by listening to the changing sound.