I don't believe in karma. But I do believe that to some extent, what happens to us is a result of our own behaviour.
I had a friend who was emotionally very very needy. No difficult past, no troubled childhood or anything (I knew her family well and had heard about her childhood and the rest of her life in minute detail).
She was always the kind of friend to cause drama in any situation, to make herself the centre of attention. She would gladly have you listen to her (mostly trivial) woes at length but was never there when you needed a friendly ear.
As time went on I discovered a really unpleasant side of her character; she would drop female friends like a hot brick at the first sign of male attention. She would court attention from other's boyfriends (including my own, thankfully he thought it was ridiculous) and cheated on one guy who absolutely worshiped the ground she walked on. When he moved on she worked tirelessly to split him and his new girlfriend up, and managed it. New girlfriend was a former friend of hers. On a holiday we went on together, she ditched me on day 2 for a guy she met. I spent 10 days wandering round a strange town abroad on my own.
This continued and continued until I deliberately distanced myself from her. I avoided her for decades and only had very minimal contact through mutual friends.
For one reason and another, we are back in regular contact. Her life to date has been a series of failed relationships. Multiple instances of long term sick from her job. Very little career progression (she is intelligent and capable of much more). Her working relationships are entirely dysfunctional. Three broken engagements, multiple incidents of cheating by her and on her, she is now single and pregnant.
I don't feel glad about any of that. Not at all. I am doing my best to help and be supportive while maintaining emotional distance as I know it will be a draining relationship that I get nothing in return from.
But I do think that her situation is the result of the way she has treated people throughout her life. It's like she has never learned from any of her experiences. I'm guessing her self esteem is through the floor for her to behave the way she does, but while she continually tramples over others to make herself feel better I can not engage fully as I know I will be completely dispensable to her should a better (male) offer come along. I have a family and a full time job and can't spare the emotional energy she absorbs.