I don't really get people. I guess some guys, probably most guys, would say "I don't really get women", but to be honest guys and girls can act equally unpredictably. We're all human. We're animals. Animals are in nature unpredictable.
Do what won't hurt you. I'm not telling you to leave her or stay with her. But I would tell you to judge what would be the best decision. Talk to her about why she acts in such a way. If you don't get anywhere with a simple conversation, then maybe it's time you leave her before you get dragged along for longer and the pain lasts longer and slowly gets worse.
As for explaining her behavior, I haven't got a clue. I could explain a lineup of different human behaviors through psychological nomenclature, and what brought on these behaviors, but things like this just stumps me. Could be because I don't have much experience in that area of life.
In any case, you know the cliché.. there are plenty of fish in the sea.
I hope things turn out well.