There is a small drive that store music data that get converted and sent to the headphone in the form of a analog signal. Kind of like a simply computer.
An MP3 player works by installing files which you download online, and placing them onto it. The MP3 player reads the MP3 files, and plays them out for you to listen to music.