The battery provides a steady DC current to light the LED. Under the influence of the battery alone, the LED glows at a fixed brightness. The resistor limits the current so the LED doesn’t burn out.
When the music player is turned on, it puts out a weak but changing electrical signal via the headphone port. Normally, these signals would make the headphone’s speaker vibrate, but here the signal makes the LED flicker.
The LED may not look like it’s flickering, since most people cannot see a change in brightness if it happens more than 18 or so times per second. Most songs have frequencies between 40 Hz and 18,000 Hz, so the flickering will be happening too rapidly to notice.
The flickering light hitting the solar cell causes it to generate an electrical signal that will vary in synchronization with the flicker of the LED. This signal is amplified and fed to the speaker, recreating the original sound from the music player.
Placing an opaque barrier like your hand between the LED and the solar cell cuts off the light, so the solar cell is unable to generate the varying signal.
Modern communications systems, such as long-distance phone lines and high-bandwidth communication lines for computers, commonly use modulated light signals. The relatively high frequencies of visual light can carry a lot more information than lower-frequency radio waves. The light used is normally from a laser, not an LED, and the signals are carried by a clear fiber-optic cable, rather than through air, but the principle is the same.