Banding appears when, in a given area of the image, colors that are initially different (but out of gamut) are replaced with a unique color. This may happen during various operations, including conversion to a smaller color space.
As explained in this thread, this is the reason why the higher accuracy of the calculations made in a wide working color space and a higher bit-depth are often decisive.