The image sensor converts light intensity to an electric signal, which can be processed and recorded by the camera.
Arrangement of pixels
Every pixel is composed of at least 3 sensors, each for R, G and B.
To fit nicely in a grid, there are generally 2 sensors for green. It so happens that humans are sensitive to green so it checks out.
GB
RG