Understanding relational dynamics is complicated. Often when people seek therapy, they discover certain relational patterns and try to understand why they seek or act out certain patterns. In Psychology Today, Dr. Laura Firestone explains how early attachment affects relationship choices. She also adds that one can modify patterns if they find they are repeatedly making unhealthy or unfulfilling choices.
Here is a link to the article: