system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do transformers, power adapters and battery chargers usually emit a low buzzing sound?
gpt
Not enough hot glue

Transformers are coils of wire around an iron core.  When you pass current through the coils they generate a magnetic field, since we pass alternating current through the coils they generate an alternating magnetic field

Every time this field ramps up it physically squishes the iron core and pushes the wires away from it, and then switches to pulling the wires towards the core as the field flips.  For big power pole transformers this is tens of pounds of metal moving about and it rattles and generates that characteristic 50/60 Hz hum you hear from them

For things like phone charges, they're using a much higher frequency(132 kHz is common) to let them use smaller transformers so you won't hear the sound created by each cycle, but you will hear the natural resonance of the core vibrating over time.  A big ol' dollop of hot glue is generally the solution to this problem and connects the core to the housing and damps out the vibrations quite well.