Inside the AMS filament buffer, you will find the filament buffer connection board. This is equipped with a Hall sensor, which monitors the filament load level by registering changes in the position of the buffer slider.
Further information can be found on the Bambu Lab Wiki.