Why does my screen brightness change constantly

Your computer may include an ambient light sensor and the adaptive brightness feature is enabled. The light sensor can detect the intensity of the surrounding light. Using data provided by the sensor, the operating system can dynamically adjust the screen brightness.

The adaptive brightness feature of the operating system can be disabled. For Windows operating systems, adaptive brightness settings are usually found in Settings > System > Display.