If you're shooting RAW, this data is saved, along with information about the camera settings, in a RAW file. If the camera is set to save images in any other file format – JPEG, HEIF or RAW+JPEG – then further processing takes place in-camera, which typically includes white balance adjustment, sharpening and noise reduction, among other processes, depending on the camera settings. It will also include demosaicing or debayering, which cleverly calculates the correct RGB colour value for each pixel (each individual photosite, remember, records only one colour – red, green or blue). The end result is a complete colour digital image – although, in truth, if the image is a JPEG, more of the original information captured by the sensor has been discarded than has been kept.
You conventionally hear about the number of megapixels (millions of pixels) in a sensor, but strictly speaking the sensor does not have pixels at all, but sensels (distinct photosites). What's more, there is not a one-to-one correspondence between sensels in the sensor and pixels in the resulting digital image, for a whole range of technical reasons. It is more accurate to describe a sensor as having a certain number of "effective pixels", which simply means that the camera produces images or videos of that number of megapixels. The Canon PowerShot V10, for example, has a sensor described as approximately 20.9MP in "total pixels" but some of the sensor data is used for technical processes such as distortion correction and digital image stabilisation, with the result that the PowerShot V10 delivers video (with Movie Digital IS) at approximately 13.1MP and still images (which undergo different processes) at approximately 15.2MP.