Built into iPhone are two small but intelligent sensors that pick up cues from the environment and adjust the screen accordingly. These sensors both work to maximise the battery life and improve your iPhone experience.
Ambient light sensor.
The ambient light sensor in iPhone automatically brightens the display when you’re in sunlight or a bright room and dims it in darker places.
When you lift iPhone to your ear, the proximity sensor immediately turns off the display to save power and prevent inadvertent touches