Yup, light sensor to detect headlights. You will see the same thing on the front of mirror as well to detect day/night. Mirror only dims if front sensor detects night time and rear detects light. You can test this by covering up front sensor and shining light into rear facing sensor.
2012 JKU Sport Silver - Max Tow, Trac-Lok LSD, Auto, Sport S package, Hardtop.
MODS: See garage, bunch of fun stuff underway.