Face ID uses infrared to scan your face, so it works in low lighting conditions and in the dark. The TrueDepth camera also has what Apple calls a "Flood Illuminator," aka an infrared light that illuminates your face in the dark so the dot map and the infrared camera can do their jobs.