It grabs the first element, removes it from the array, and returns the removed element. It's basically a way to treat an array like a stack: shift is pop, unshift is push.
shift and unshift0 acts in similar way as unshift1 and unshift2: they are meant to use arrays as stacks to which you can append and remove elements (usually one per time). The difference is just that shift and unshift add/remove elements at the beginning of an Array, actually unshift3ing all other elements, while pop and push add/remove elements at the end of the Array, so preserving other elements' indices.
Examples:
# Spacing for clarity:
a = [2, 4, 8] # a => [2, 4, 8]
a.push(16, 32) # a => [2, 4, 8, 16, 32]
a.unshift(0, 1) # a => [0, 1, 2, 4, 8, 16, 32]
a.shift # a => [1, 2, 4, 8, 16, 32]
a.pop # a => [1, 2, 4, 8, 16]
If you can think of the array as being like a queue of values to be processed, then you can take the next (front) value and "shift" the other valuess over to occupy the space made available. unshift puts values back in - maybe you're not ready to process some of them, or will let some later code handle them.