The first is a proximity sensor that uses a magnetic field to turn on the backlighting when your fingers near the keys, then turn it off when you pull away. The second is an ambient light sensor, which adjusts the brightness to match the lighting in the room