I consider it a matter of mutual respect. Early humans and dogs are both pack hunters and likely stalked the same prey.
I figure dogs were pretty impressed with our take-downs and were glad to share the spoils, and vice versa. Throw in a warm fire and you got yourself a friend.