A camera's light meter โ it adds up incoming light over the exposure to set the right brightness
The sensor collects photons continuously while the shutter is open. Summing that light intensity over the exposure time is an integral, and its total decides how bright the final image turns out. Brighter scenes reach the target sum faster, so the camera shortens the exposure.