FaceID uses infrared, lighting conditions do not matter.
You can disable the requiring of looking at the phone and unlocking via FaceID in settings, I regularly unlock my phone without holding it so I am "dead on looking at it".
On the controrary it does not work in complete darkness, dim light is fine.
My iPhone 12 never unlocks with Face ID in the middle of the night, and neither did my iPhone XS. I can however see a faint red light flash from the sensor when it tries, I guess this is spill-over into the visible spectrum from the IR.
You can disable the requiring of looking at the phone and unlocking via FaceID in settings, I regularly unlock my phone without holding it so I am "dead on looking at it".
That said, I also prefer TouchID.