So, I just got shocked by my iPhone 5S whilst it was charging. Not enough of a shock to cause injury, but enough that it hurt.
After poking around at it for a while, I have determined what appears to be the cause.
First of all, the phone was plugged into two wires: A genuine Apple lightning charger, and a 3.5mm jack connected to the LINE IN port on an external USB sound card. I’m specifying that it was a genuine charger as I know that non-genuine ones often have safety concerns that could have directly caused this issue.
I’ve always noticed a strange, faint buzzing feeling if I touched my phone’s metal back whilst charging. It is now apparent that this feeling was the current from the charger somehow managing to form a connection with the back of the phone, and then earthing itself through my hand.
The LINE-IN cable earthed the phone. When I unplugged the sound card’s end of the 3.5mm jack, it meant I was touching the earth of the phone, and so the current flowed through me and into the ground.
I’ve measured the current with a multimeter, and found that the current between the LINE-IN port and the phone was 0.4A.
So, long story short, iPhones (well, my one, at least) are able to deliver an electric shock to you under certain circumstances.
(Insert cheesy joke about ‘shocking behaviour’ here.)