Dogs are jealous creatures.
They get very jealous of the attention the human gives to other dogs and the baby.
I see this all the time with our Chihuahuas.
The difference is that the Chihuahua can not kill me. A pitbull could.
It is also a case of the dog meting out discipline that is meant for a dog and not a baby.