Yeah I've dated two of these. Threatening to leave/storming off all the time is for attention, to get you to back down, to get you to shut up, to make sure you don't ever raise the same issue again, for control over you, because they want to be soothed, to make things unequal between the two of you, as a power play, to keep you in your place, to upset you, to cause you emotional distress, and because it works.
They love to have you running after them and chasing them. When you stop chasing, they often escalate things and goad you to get the reaction they want. It can get really nasty if you don't give in to the temper tantrum. You can have them packing bags and flinging things all over the house or blaming you for literally everything under the sun, dragging up old shit (but obviously you're not allowed to do that to them), they can call you names, disappear for longer and longer, get violent or aggressive, and even threaten suicide.
The first one it took me a while to figure out. I said if you do this one more time, it's over. Of course he did it again.
So I said ok we're broken up now like you wanted. He had the surprise of his life. Literally begged and begged me to come back after he realised insulting me or trying to blame me for what happened wasn't going to work.
The second one, I worked out his MO a lot faster because I'd been through it before and I'd already tried literally everything to get it to stop. I gave him some chances and then the next time agreed it was over. Again, he couldn't have been more surprised. Again, more insults, blaming, gaslighting. Then begging and begging for another chance. I said you've already had enough chances. He was heartbroken but he was the master of his own misfortune.
They just want attention because they're full grown babies so they throw their toys (i.e. you) out of the pram. You'll come crawling back and they get to feel like the big man.
Please don't waste your time trying to change them. They don't change. The only thing that works is ignoring them and agreeing that you should break up. Whatever horrible thing they said, grey rock it and just blandly agree that the relationship isn't working.
Give them one chance, if you want to. Say if it happens again, the relationship is over. And it will 100% happen again. I guarantee it. I'd bet my house and my car on it.
It's a horrible emotional rollercoaster and they don't care one whit about you as long as they get what they want out of it. It is abusive and you should not put up with it.