Answer:
It means that the dog realised that Gobaly wasnt an enemy. So whilst he may not have literally understood, since he's a dog, he still knew that Gobaly was friendly and did not mean any harm.
Gobaly is gentle and careful so that makes him a good friend.