To expand, the electricity from your iPhone is merely a control signal that goes from the positive side of the iPhone jack, through the cable, into the control portion of the amplifier, back down the cable (through a different conductor) and into the negative side of the iPhone’s jack. Like any other electrical circuit, it forms a loop. It if didn’t , no electricity would flow and nothing would happen.
On the amplifier end, the iPhone’s signal controls how much electricity goes from the car battery, through the amp, and into the speaker. The two circuits are electrically separate though, so there is no actual electricity flowing from your iPhone to the speakers when you hook it up to a car stereo or other amplified system.
And as @prescottman2008 says, there is heat generated. N o circuit is ever 100% efficient; there is always some loss and much of that takes the form of heat.