I'm making the point, it can be a combination of both factors Vicky. You've probably heard the phrase: "hurt people, hurt people." Right? That is, those who are emotionally wounded transfer their pain onto others because it is too painful to own.
Similarly, to use an example for my second point: if we have low self esteem, others become aware of it and mirror this image back, in their treatment of us. We are continually broadcasting to others, our unconscious beliefs about ourselves. Hence, why healing our wounds is a painful process that many people never undertake, but sweep under the carpet.