Switchmode units - the sort that are small and light - have active electronics and tend to operate at frequencies that are above human hearing range. You see often them in phone chargers and laptop supplies as well as modern TVs, but are used in a wide range of applications.
Simple transformers are the ones that you can hear hum.
I feel the volume of this hum is dependent on two factors:
1. The current flowing through the windings. The greater the current, the greater the magnetic field and, thus the greater the forces acting on anything conductive within that field.
2. The physical size of the transformer. The bigger the unit, the more surface area there is to couple to the surrounding air. Bolt it to a chassis and that coupling increases significantly.
The fact that you will often find big transformers handling larger currents, means they will more likely to hum more audibly than small ones.
This hum can be a useful diagnostic tool. If you hear hum, then you know it has AC power running through it. Sometimes you might have to use a screwdriver as a stethoscope to hear it. Also - once you have heard a few transformers operating - you will get to have a good idea of when a transformer is operating normally and when it is struggling. This can alert you to a problem before the magic smoke has made an appearance.