The biologist should'a checked for squirrels or deer just beyond the fence or run.
Only a scientist could not figure out why dogs are barking in a given situation.
To warn off intruders into their territory, to get attention such as to be released from a leash or let out of an enclosure, for food, when a pack is running together so they can stay together and make themselves known to each other, to threaten, to greet people or other visitors.
I’m sure I left some out.