Humans, like mammals, like it when we belong. This is pre-verbal and pre-cultural, in the sense that all babies feel good when someone sees them with kind eyes and feel bad when they’re left alone.
However, on top of these pre-verbal drives, we learn about the world through our experience and our thoughts. If our guardians are kind and consistent, we learn to expect that and we ourselves become kind and consistent. If our parents are unkind and inconsistent, we learn that.
By the time we become adults, we bring many of those learnings into relationships. We may be kind and consistent with our partners. Or we may be unkind and inconsistent.
As with many things, we can change. In fact, you can have one attachment style in one context and another attachment style in another context. This depends on the specific schemas or thoughts and experiences that you have.