Interpersonal relations are complex. Without going into a lot of discussion and having time to explore feelings and personalities, there is no way to answer such a troubling question. Could you possibly convince her to go to marriage counseling with you? Let her know that you are committed to the relationship and that you just want to find out what, if anything, can be done.
It's a tough one. I sincerely wish there were some kind of simple answer to what you describe, but there isn't.
A marriage counselor may not actually solve any problems, but a few sessions may help figure out what's wrong and at least give you some form of answer.
Redbeard gave you excellent advice, but I would also like to add that to complicate matters more if your wife is 40 plus, then it's possible she could be having perimenopause (hormonal changes) or be starting into menopause (also hormonal changes and this is the ceasing of a period.) Hormones believe it or not in especially women are a great deal of the reason why they can act strangely at times and that's why most wives or women in general don't know what to say to their spouse about the way they feel.
PERIMENOPAUSE/MENOPAUSE SYMPTOMS: Moodiness, happy one minute, angry or depressed the next. Hot flashes (she will complain of being either too hot or too cold.) She may have problems falling asleep and if she does sleep she is throwing the covers off one minute and pulling them back on because her body has cooled down. She may be depressed. She may often feel she looks just great and the next minute reduce herself to tears thinking she looks terrible. She will cry over nothing and can't explain why. She may pick on you and there isn't anything you can do that's right. If any of these sound familiar to you then PLEASE talk to your wife and see if she'll consider going in for a physical and having a hormone test done (blood test.) She may well rip your lower lip over your head, but hey, this is a marriage and it's worth saving! Make suggestions such as she could take night courses in something she likes, to even going to college for extra courses.
Most people know so little about what hormones can do (even men go through Andropause similar to women's menopause, but not as severe) and some women connect going into Perimenopause or Menopause as "your life is over and I'm just plain old and useless." I've been through it and can contest that life is far from over and I've never felt more freedom. I opted out on hormone therapy because long-term can cause breast cancer, heart attacks and blood clots. I went "Homeopathic and antidepressants for a short time and found ways to deal with some of the symptoms. Instead of hanging around the house I'd exercise (Tai Chi) go out with friends, took night school courses and realized the whole thing was about just another chapter in my life and I now had a chance to find out what talents I really had. I found out I was good at writing and was encouraged by many family and friends to continue on with it, which I did and also I am good at art (drawing.) I have had a few articles printed in our local papers, and I am writing a script at the present time. Whether it's accepted or not doesn't really matter because I think it's good. I do artwork for the Abused Women's Center and a Pet Network. I never had a chance before to tap into those talents because I was far too busy.
Have that talk with your wife. If she will not reason with you then see if she will consider a separation first and not a divorce. This may give her time to clear her mind and find out what she does want.