During the relationship , you may not seem happy , and may always seem like you want to leave him etc. But when you guys actually break up , everything changes. You feel completely lost , and you just need him there. What I'm trying to say is.... when he's there with you, you don't care...when he's far away from you, you can't live.... Because she's even less happy without it.
What brings a person back to their ex's , is that they can't let go of the past. They are still stuck in the past. Even though she may state that she wasn't happy in the relationship its clear that she does miss some parts of their relationship but won't admit it out loud. If you keep going back to the past its evident enough that you miss what happened in the past Going back to an ex is familiar ground, you don't have to worry about "first dates, how you look, what they would like," because you already know from your past relationship with them.
Some girls want what they can't have. So if they have the boy, they don't care about what they have. They want what they can't get. So when they breakup the girl changes and wants the boy back. It goes through this cycle until they come to a solution, breakup or stay together. And also, if she really was happy in the relationship and just not acting it, that will shine brighter than the sun. She will feel lost, hopeless, as if a shadow has been cast over her life. They need the boy back, the sun, the hope, their guide.