The switch works by connecting two pads/conductors on the PCB or inside a microswitch. For a PCB switch, often a small metal dome with an indent is placed over the pads so that there is a tactile response when the button is pressed.
If you're wondering how the buttons actually start/stop/pause the MP3 music however, you'll find that they don't - the state of the switch (i.e. ON or OFF) is read by the MP3 controller (an IC), which can control how the music is played/stopped/paused/etc.