>>106330576
Electronic devices often have main earth ground (the one in the wall socket) connected directly to their own internal GND as well, which in turn is connected to GND on all their other external connections too. So for example if you want to plug a PC into an audio amplifier and both devices use grounded plugs, then once you connect the audio cable as well you also link the PC's GND with the amplifier's GND. These are already connected however, through the electrical system in your house, so when you add the audio cable that connects them as well you're adding a 2nd connection between them and as such create a loop. If the mains earth ground on the PC and amplifier is at different potential, then by adding that audio cable which makes a loop you have now provided a path for the current to flow through due to the different potential on the plugs the 2 devices are using. This current flow can sometimes be heard as a humming noise through the speakers the amplifier is hooked up to and is obviously undesirable.
Optical audio (TOSLINK) does not suffer from this problem because the cable is just plastic, it does not make any electrical connections at all and as such cannot form a ground loop.