I can give a quick explanation:
Enemies become alert when they see you for the first time
After they become alert, their vision (both when you are in and out of light) gets larger
If they see you again, you lose
They will investigate interesting things, such as if something was broken. During investigation, their vision will be limited to a cone in front of them