When a 3.5mm jack of headphones contacts with sound device's socket, headphones produce slight noise. Why does this happen when only one wire is connected? I thought there are supposed to be at least two contacts to make a speaker produce sound.
I would guess that this has to do with a Ground Loop and the other conductor is your hand.
My guess is your ground is floating and full of high levels of common mode noise perhaps from a floating external charger.
The imbalance loading of headphone cables can be enough to induce a differential voltage. The transformer has capacitive coupling from primary to secondary. The secondary has a floating ground. The headphones are only connected by a single wire on the tip. There is a stray reactive coupling to free space which is also coupled to the input charger cable.
Increasing the coupling (or lower impedance) to a common mode ground will suppress the stray hum. (e.g. AC ground).
Also connection of low impedance load to both headphone contacts, tip & ring would suppress the stray common-mode.
It's because one of the devices is plugged into the wall. 60Hz (for the US) noise is present in almost anything indoors. The signal for audio on your headphones is a voltage, voltage is not an absolute measurement, it's always relative to something (which we usually call ground). When both contacts are made for the single channel of a headphone the voltage being translated to sound is the difference between those contacts. Usually those contacts themselves have 60Hz noise on them, but as long as it's in phase, it won't affect the audio signal. If you only touch one contact, there isn't any in phase 60Hz noise on the floating contact to cancel the noise, so you'll hear the 60Hz on your device.