In its support page , Samsung explains how the sensor's light-emitting and light-receiving components work in tandem. Simply ...
When you're talking on a modern smartphone, the display will turn off as soon as you bring the handset to your ear. The feature is meant to prevent accidental taps or interactions with the display.