What you are hearing is mains hum: mains electricity is alternating current (ie the voltage is approximately sinusoidal and symmetric about zero), with a frequency of 50Hz or 60Hz. things like kettles and heaters use a lot of power and parts of them will mechanically change shape at this frequency, which is audible. This kind of physical noise from things arises because the electromagnetic field due to the large, changing currents is strong enough to physically move bits of metal in the device around very slightly, which you then hear.
A good way of thinking about this sort of physical sound is that the thing is acting like a primitive loudspeaker: there is a 'coil' which is often a single turn of wire such as a kettle element, through which is flowing a large cyclically-changing current. This causes a large, cyclically-changing field and other (ferrous usually) parts of the thing move in this field. (In a loudspeaker it is usually the coil which moves, but the principle is the same.)
In practice the frequency you hear is often double the frequency of the mains itself: 100 or 120Hz.
Systems which use DC don't hum like this, although if they use high currents there will often be a significant bang or thump when they are turned on or off.
Mains hum of a slightly different kind is also a pestilential problem to people who design audio electronics as it leaks everywhere. The mechanism for this kind of hum is often the field from the ambient mains inducing voltages at the 'front end' of amplifiers, although it can arise due to poor power-supply design as well.