If I remember correctly, the image as captured by the sensor and saved as RAW is actually B&W, with software converting it to color. Probably too simplistic, but I think that's the general idea.
The raw file contains monochromatic photosite data based on the spectral properties of the color filters that is then converted into RGB upon demosiacing. Not really correct to call it "B&W".