Typically the important melody line is the main vocal line, but not always. There are many delightful examples where the main vocal melody has very little movement, and an instrumental line (or sometimes a backing vocal line) steps in with an interesting background melody that moves that song forward.
This comes naturally with rap vocals, because rap is inherently an unpitched style of vocals. But you'll find it also in funk and blues-based rock, where the vocal line might stick to two or three notes while a repeating riff holds the melodic spotlight. And you'll come across it in the chorus of many uptempo rock and pop songs, where the main vocal hook is just a staccato exclamation, and it's the instrumental parts that make the chorus catchy.