There is an entire field of psychology behind it ...
Human beings can mimick bad behavior from parents.
My older brother did. He was also abusive to his children.
Or people can subconsciously attract partners like their parents. If a woman had an abusive father, she may attract an abusive husband later in life.
If people self-reflect and heal their childhood wounds, then they can navigate this.
But we're not taught this in school. So where do you pick it up? I used to read a lot, including psychology.