Dogs are smart that way also they like to get away from their poop and Joe was probably reeking of it.
That dog tried to 'go to' the guards, and away from Biden. It was afraid of Biden.
That reeks of an abusive situation or personality on Biden's part.
Like you said, dogs are smart that way, and sense hostility.
Anyone who doesn't believe that, watch your dog when it is in trouble.
You don't even have to ever have abused or disciplined the dog, it will pick up on your discontent, and even if you are angry about something completely unrelated to the dog, they catch that vibe..