There’s something in your camera called a meter.
This meter has different metering patterns and measures light intensity.
Some of are aware of the meter and use it while in the process of making a photograph in manual exposure mode.
Some of us are not aware of the meter but it’s still used while making a photograph in an automatic exposure mode.
In any event, while the meter provides us with a measurement of light intensity it also provides us, via the camera, with information that is used to drive our settings in terms of aperture, shutter speed and ISO to begin to get the best composed pictures possible.