The color filter plate leads to the sensor and by measuring the difference between the bits of the glass plate, the camera produces colors corresponding to each pixel to display.
However, there are some limitations: the sensor has a certain noise level - it is the random value in the sensor, although the exposure is how much. Low noise sensors will be harder to make and more expensive. For most normal cameras this is not a problem because just having enough light will not interfere.
But as the sensor gets smaller and smaller, the less light you get, the more noise it will reduce. To push the number of megapixels up (for advertising purposes, for example), many manufacturers also allow for increased noise levels, although this also reduces the overall quality of the image.
There is a problem. As the resolution increases, the lens quality also reaches the critical point. Cheap lenses often have a certain degree of blur, increasing the resolution of the image sensor is greater than the quality of the lens that will increase the number of pixels but not enough information for those pixels.
Worse, the difference between the lens quality and the sensor's resolution may cause false colors because light passing through the color filter can go to the light sensor corresponding to another color, causing inaccuracy.
So when buying a phone and want to choose a good camera, don't just care about megapixels. Look at the color accuracy, the ability to capture low light and the quality of the lens. However, very rarely do you know these parameters from the manufacturer, so another way is to look at reviews from trial use and compare these cameras with other cameras.
See more: