Some call it people-pleasing, while others call it having no boundaries, acts of service, being overly kind, finding happiness in making others happy, or getting the job done.
The mechanism is self-sacrifice or self-neglect, which is a complex form of control, a distraction from one's insecurities, and a means of creating a sense of self-value.
People who behave this way typically had to act this way to survive, which for a child meant gaining the attention, affection, and validation they needed to feel lovable, significant, and worthwhile.
Growing up with unavailable or demanding parents, siblings competing for attention, or authority figures who only praise performance can drive someone to behave in ways that displace their own needs for recognition from others.
Most people who live this way hate it too, because they do it against their will, feeling they have to in order to feel valued by those they love. When asked, their preference is to be loved for who they are rather than what they do. Sad story :-(
Helping people understand WHY they do this seems to be the only way to help them effectively unlearn this way of being.
"You can't pour water from an empty bucket."