Some people, unfortunately, are just absolute shits.
There's nothing you can do about it. If you've previously never had issues with bosses, then it's likely your last one just fell into this category. If you always have issues with your boss, look closer to home, but that doesn't seem like the case here.
Dealing with people like this is incredibly difficult. I've had two really bad ones in my time, with the rest being the usual mix of really good and plain average. What have I learned?
A bad boss is toxic to your self esteem and career. At the first whiff of badness you need to ask yourself one critical question. Can I manage them or do I need to move on? If you can manage them then you should. You can find many articles online about different personality types and how best to deal with them. What you need to be able to do is realise when you can change the dynamic and when you can't. When you can't, it's a waste of your time and self esteem to try and that when you get out.
So my previous bad boss was a sulker and a shouter. I managed him for a while with the "don't you dare treat me like that" and the "if you're going to act like a toddler I will treat you like one" approaches, I.e. Assertiveness right back and refusing to engage with bad behaviour.
My current boss is one I can't change. When I joined my current organisation I had a different manager, got promoted, did really well. They department reorganised and I got a new boss. She's terrible. Disinterested, plays favourites, doesn't turn up to scheduled 1:1 s, constantly harasses my direct reports for dirt on me (I've seen the emails.) it's a horrible situation to be in and I've realised a I can't change it. So, when I'm back from mat leave, I'll move if I can within the organisation. There's no point making myself any more stressed and down than I already am.
So in answer to your question : you'll drive yourself demented asking why. You'll never find out. It could be that she doesn't like you. Or she's threatened by you. Or is one of those people who need a scapegoat and you're it. Or needs to put others down to make her feel better.
What you need to do now is regroup, and tell yourself that you will NOT let this happen again. You may be put in this situation again, for sure (plenty of shitty people out there) but if you see history repeating you need to start on your exit plan. It'd be lovely to take arseholes like this down, but in the real world HR are not your friends, management close ranks and your health is too precious to waste on idiots like that.