It's a life's work to learn about these things. I really only rather recently figured out that I have real trouble drawing boundaries and this can encourage others to feel justified in hurting me or treating me poorly. Doesn't exactly restore any faith in humanity.
I suppose it makes sense since growing up my boundaries were violated many ways before I even had a chance to fathom what a boundary was- I was violated emotionally and physically every day for many, many years.