I'm thinking it has to do with the range at what they get detected. Some units can hide so close to the enemy that they can nail them in less than 2 seconds. Also it seems the unit getting targeted has a huge delay in command ability as the comp always turns unit's around when you are going to hit them in the back but for some reason they never turn if the unit just came out of hiding.