Why night photos come out grainy
Grain is not a fault in your phone. It is what a picture looks like when too little light reaches the sensor, and every camera has it. Phones just run into it sooner.
Light arrives as a random trickle. In daylight each pixel collects plenty of light, and the random variation between neighbouring pixels is tiny compared with the signal. At night each pixel collects far less, so the same randomness becomes a large share of what it records and shows up as speckles. This is called shot noise, and no amount of engineering removes it at capture: the only real cure is more light.
Phone sensors and pixels are small. A phone sensor is a fraction of the size of a camera sensor, and each pixel is tiny, so each one catches less light in the same scene. That is why the same street at night looks clean from a full-frame camera and grainy from a phone. Our guide on why phone photos look bad up close covers this in more depth.
The phone turns up the gain. To make a dark scene look bright, the camera raises its ISO, which amplifies the signal and the noise together. It also keeps the shutter short so that your hand and the people in the scene do not blur, which means even less light.
Colour suffers first. In the shadows the camera has very little colour information, so noise shows up as red, green and purple blotches, especially in dark skies, walls and clothing.

