This, in addition to their natural instinct to spot contempt, fear, stress, anxiety etc in people will trigger the barking.
A dog doesn't bark without a reason.
If you observe the person whom the dog barks at, there might be something - like restlessness, anger etc in him - which the dog can detect.