The general reasons dogs bark at other dogs, as mentioned, are anxiety, frustration, insecurity, and attention seeking. Sometimes two or more of these reasons work hand in hand.
So how do you tell which particular reason applies to your situation?
Well, one specifically important factor to consider to understand why your dog barks non-stop is the condition surrounding the act in the first place.
For instance, why does a dog bark at other dogs walking by the house?
The answer to this may be due to territory, a sort of declaration by your dog that says “get off my lawn”, or “this is my house”.
Then there’s the question of a dog barking at other dogs while on a leash. This, too, is usually down to anxiety.
You see, while on a leash, a dog has limited options when faced with unfamiliar situations.
Off-leash, it is easier to deal with these situations by running away.
On a leash, however, the reaction range becomes limited, and many dogs choose to deal with it by being on the offensive, either by barking or growling at other dogs.
Then of course a dog may just happen to be easily scared by other dogs, which, in turn, cause inordinate fear that is expressed through barking and lunging.
It is also worth keeping in mind that just because your dog growls at other dogs while on a leash does not mean that your dog is aggressive.
In fact, sometimes it is quite the opposite, and just shows how friendly the doggie is.