These advanced mirrors have multiple parts that all play a role. Two layers of glass make up the mirror. In between the layers, there's an electrochromic gel. Plus, these mirrors have light sensors integrated into them.
When the sensors detect bright lights, they send electric signals to the electrochromic gel. This type of gel responds to electrical charges, so when it receives that electric signal, it darkens. As a result, light has a harder time passing through the gel. When someone is driving behind you with bright lights, less light from their headlights can reflect through the mirror. You'll have improved reaction times since you'll have an easier time seeing what's around you.