why do we force ourselves to detach from people we care about?

Well, in my case, I know the answer - to prevent them from hurting me in the future. But like.. why? Why can I only maintain a relationship with people I care about as long as I remain emotionally detached so if they decide to leave me I won't get hurt? It explains why I refuse to reach out to the people I really want to talk to and why I can't cope with physical intimacy. Any other geminis experience this or is it just my DA attachment style?