How does the Macbook check the ambient light to determine the screen brightness, does it have a separate ambient light detector buried under the screen somewhere or inside the camera? (if the camera is not used for this I mean which would have been the best thing to do, but would require the camera to grab frames now and then without the LED flashing)
There is a third little dot near the camera you can see with a flashlight and that's an ambient light sensor.
In this vein, apps on your phone likely have unrestrained access to the photosensor, and researchers have figured out how to take low-resolution photos with it: https://news.mit.edu/2024/study-smart-devices-ambient-light-...
Macbooks have a dedicated ALS (Ambient Light Sensor). They don't use the camera.