^^ The barking is clearly 'explained' by Jan Fennel - see above.
All dogs of any size, down to chihuahuas still carry the pack instincts brought down to them from the wolf. It barks to alert the alpha dog (the owner) that there might be danger. In the wild, the alpha-male will come to asses the situation, if he thinks there is danger he will address it by moving the pack, or fighting if he has to. If he sees no danger, he conveys that to the alarmed dog and it will stop.
The dog of which you speak simply needs re-assurance, but unfortunately this can only be given by the owner - who of course, isn't there.