The most common reason by far is to protect their offspring in a nest nearby about which the dog or anyone else is blissfully unaware. The attacks bemuse the dog or cat.
The picture below is a screenshot from a video which I can’t upload to this site so a screenshot will have to do. The words accompanying the video are below:
Occurred on May 28, 2023 / Talayan Village, Quezon City, Metro Manila, Philippines: “I was jogging on May 28, 2023, 8:13 am, and saw this dog coming towards me. Then I saw the dog being chased by a bird. So, I took my iPhone and shot the video.”
Buzz Videos
Although there might be several reasons why a bird attacks a dog, the overriding reason and the reason why a bird attacked the dog in the picture above in Metro Manila, Philippines was because the bird was protecting their nest.
The dog wondered into an area which was quite close to their nest and as a precaution the bird tried to chase the dog away. It is obviously an act of bravery because of the size difference but it is instinctive. The picture is from a video of that bird attacking a dog. The video was made it 8:13 AM in the morning on May 28, 2023 with an iPhone is that interest you.
Cats
And this reason to protect a nest is exactly the same reason why you see magpies most often attacking domestic cats in the UK or America or indeed any other country. The videos that I have seen are from the UK and America but they are identical in that the bird courageously pecks at a cat minding their own business, doing nothing. The bird gingerly approaches, takes a peck at the animal and then backs off quickly. It’s more a message to go away than an attack.
Hatchlings
An associated reason would be that the bird is safeguarding their hatchlings. There may be some baby birds nearby taking their first steps outside their nest and their parent wishes to protect them.
Food source
Another, I would suggest relatively uncommon reason would be a bird guarding a food source. This might apply to territorial species such as starlings, sparrows and robins for instance.
Pets
Experts say that sometimes birds have attacked pets and stolen the food of those pets when they are very hungry. This must be very rare too.
Grudges
Sometimes a particular bird may have had a bad experience being chased by a pet and they remember the experience and instinctively defend themselves when a pet presents itself. Crows have good memories, I’m told. Studies suggest that birds inherit grudges and behave aggressively towards pets or people who have caused them distress in the past.
Familiarity
It might be fair to say that some birds become very confident around pets which would increase the possibility that they will attack a pet who jeopardises their offspring in a nest.
Conclusion
I’m convinced that the overriding reason for birds attacking cats and dogs is a defensive measure to protect their offspring in a nest nearby about which the dog or cat is entirely unaware.
Risk
I’ve seen cats completely bemused by these irritating attacks and I’ve also seen one cat retaliate by jumping high into the air as the bird flew away, catching it and killing it. These birds do take a risk with their lives.