Ahh .. I remember my physics text book explained that part..
Basically it converts those vibrations of the strings into electrical signals , then send it to a amplifier to amplify the signal (since the original is too weak) then viola , you got your sound.
Correct me if I'm wrong..