Grief is a state that about replanning, essentially. We all have a very nuanced and complicated set of subconscious plans to get all the things that are important to us. Everything from basic survival to social status, we have a model of how to consistently get in our lives. Friends, family, work, personal habits, all of these things interweave to create a complete system for our lives being okay according to us. Of course this can go wrong--we can get stuck believing that key things will never be better, and sink into depression--but I'm talking about psychologically healthy people.
But then sometimes those key factors in your life go away. You lose your job or your mom dies. Well, woven throughout your psychology maybe you were relying on your mom being a bedrock source of safety and support, among uncountable other subtle effects you emotionally anticipated your mom would have on you life. And then she dies, and all that goes away. You don't have a ready replacement for practically any of it--the bedrock of support, the unconditional love you once emotionally leaned on, perhaps. And so you grieve. You reimagine, from a very deep emotional level, what your life will be like. And at first it's almost too painful to bear, because at that moment it just feels like you simply won't have the many gifts from your mom for the rest of your life, and that is terribly painful.
So you go through a complex process of "figuring out," mostly subconsciously, how you're going to get that stuff. Social support gives you hope that maybe you can find support and love in a way that make things ultimately alright. Funny movies give you hope about feeling happy in the future. Remembering her, having a personal relationship with a strongly felt sense of her you still carry with you give you a sense that she may still be a source of wisdom. You lean more on your other family or friends for the same.
In the happy case, as time goes on, most of everything gets solved, and you come to feel like you can live and have a good life without her. The rest stays with you in quiet moments of missing that never fully go away, in my experience.
So this is the same during a bad breakup. You put a lot of your future hopes and dreams on the partner you no longer have. And now it feels like all that is gone forever, and it's devastating. The process is the same though -- you go about the business of reimagining your life from the ground up, being okay with living in a world where you and your now-ex aren't together.