First of all, you have to understand that what you call "You" is a very huge volume of memory and part of who you are now including your mind to a large extent has to do with the memories you carry.
These memories are gathered through the 5 senses, that is, what we see, smell, touch, hear, and taste. Of all these, what we see and what we touch, is the deepest way of gathering memories (most especially, what we touch).
So when you've had a partner for a long time, that means you've touched, not just touched but also engaged other senses. Breaking up with that person means that in some way, you are trying to rip that memory off and it won't be easy.
This because breaking up entails that you have to be finished with those memories and of course, the system will have to go through a certain process. This is when you understand the memories of your partner works in every cell of your body.
So breakup is a voluntary death cause you have decided to kill something part of you in some way. So it's important that the body has enough time to workout the memory and keep it at a certain distance.
Two people who have shared their emotions, body, sensations, and probably living spaces, because these memories have merged in many ways and ripping it apart is almost like tearing yourself apart.
So you are not just breaking up from your partner, you are also breaking up yourself because your existence has been nurtured by a partnership to make yourself feel whole in some way.
This is why break up is painful.