Vinnnyyy in phone 2, it is used as a sensor for display autobrigtness in case of strong backlight..like if backlight is strong we wouldn’t be able to see the display ,so display brightness will be increased and vice-versa.
Try covering the sensor facing the backside of the phone to bright light. U will figure it out 😉