I've spent hours typing and deleting replies to this because it's so hard and painful to explain. I'm going to try a metaphor instead because I don't know what else to do.
Imagine a proud German Shepherd. Reliable and resolute in his duties. He protects his flock and his family. Admirable, responsible, the model of a guardian dog. The thing, though, is that this came at a cost. He never knew the love or affection he should've gotten as a puppy. He was kicked and neglected to make him strong so he could do his job well. And that puppy is still inside him now and he's so hurt and so sad and so lonely and all he wants is to be petted and cuddled and told he's a good doggy.
The big German Shepherd, though, is terrified of this. It goes against everything he stands for to put the burdens of his own past onto somebody else, and he's so afraid that if he ever gets what that puppy wants he'll lose the dog he is now, the dog that can protect the flock. He thought he had it once and left his flock for it but the owner that seemed kind and gentle at first quickly turned into one that beat and screamed at him constantly and didn't even let him see his flock, and when he finally, after years, worked up the nerve to escape from this terrible owner he came home to find his flock decimated and his family in ruins.
Now he's even more certain of his role in the world. He's suspicious of new potential masters, and can't escape the guilt of leaving his flock behind to be torn apart by the wolves. However, that puppy is still in there, and it's still so sad and lonely, but the big German Shepherd, more than ever, has been so hurt and traumatized in his life that even a gentle hand that comes to pet him will be bitten, and he simply doesn't know how to change this.