Dreams about SO leaving you

Why do they even exist? I just had a dream that my boyfriend was contacted by his ex girlfriend and then he wanted to leave me. He wouldn't talk to me and his mind was set on not wanting to be with me. Although I know it's only a dream I am 38 weeks and my hormones are not letting it go.