This can be a subject for endless discussion. Go to any bass related page on facebook and you will see declarations of how important and often misunderstood the bass guitarist is, how the bass and the drums are the engine room of the band and how the bass links the rhythm to the melody and gives the song structure. All these are probably true but there are some simple principals to understand.
By filling in the low freequancies we create a fuller sound to the music which can be emphasised by deliberately not playing in certain sections. The bass is a melodic instrument which is focussed particularly on harmonising with the melody rather than playing the melody and to do this the bassist plays the chords though usually one note at a time rather than all together like a guitarist or piano player often does. The bassist has a very important role in emphasising the rhythm of the music as well as outlining the harmony. When playing with a drummer it is important that bass and drums act almost as one instrument with the bass player paying particularly close attention to what the kick drum is doing.