Over time, the wolves that prospered were the ones that got along with humans and that were able to read our intentions. They were brought into the human camp, and then breeding changed them even more.
I had always assumed that wolves were domesticated when humans nabbed a few pups and started raising them, but some research indicates that that would not have worked, because the wolves had to change first before they would be compatible with people. Who knows, but it's fascinating stuff.
I seem to recall a children's book and/or story about that man/wolf relationship. Makes sense.