This happens mostly when you’re more successful than he is.
When you have a job, a career that you’re proud of and he simply can’t keep up with you, he will feel threatened and leave no matter how much he loves you.
This also happens when he feels like you’re outgrowing him, when you’re becoming better than him in any possible way.
Men get intimidated by women’s success even if they don’t want to admit it.