My mother is mentally ill but has never been diagnosed because she has never sought treatment, despite the urging of all of us in the family. I first knew that she was mentally ill when I was about 7 years old -- she was raving about the neighbors and how they were spying on her. I remember thinking that this woman was bananas and that I wasn't going to listen to her anymore -- that is, if I didn't agree with what she told me to do, I just wasn't going to do it, period. I guess I basically just lost all respect for her at that point. She would have full-blown conversations with herself and she would fly into rages over little things. My dad would ignore her and work all the time, leaving me alone with her. At first I walked on eggshells around her, but when I got into my teens, I started fighting back -- when she got angry, I would get angrier. Today she is still erratic, but not nearly as bad as when I was young -- for example she still talks to herself but takes more care to hide it now. The effect on me: I was anxious and ashamed all throughout my childhood. I was angry and I had huge trust issues. I never brought friends home to play or to sleep over because I didn't want them to see what a crazy mother I had. I would go over to friends' houses to play and see their parents, and wonder what was wrong with my family. On the plus side, since I basically saw myself as alone in the world without emotional support from my parents, I was very independent and self-sufficient as a child and teenager, I excelled in school, I made close friends who are still close friends to me today, and basically just learned to look for family in other places.
The effect on me as an adult: I didn't have a good relationship at all with her while I was growing up, and I still have a terrible relationship with her to this day -- I barely speak with her, I left the country when I went to college to get away from her, and I rarely visit. I also had a very hard time becoming a parent. When I became a mother, all of the shame, anxiety, and anger that I'd spent years ignoring came rushing back. I doubted that I could ever be a good mother -- I thought that I was somehow deformed or infected with bad mothering genes because of my own terrible mother, and I also didn't know the first thing about being a mother because I'd never had a role model and so I felt insecure and scared about becoming a parent. It also was hard because I would look at my wonderful, vulnerable little baby and later this rambunctious, hilarious toddler and then kid, and think, "How could my mother have treated me so badly? I couldn't bring myself to do that to my child." I spent a lot of time being sad during the first few years of my kid's life. Therapy has helped, and continues to help, but it has been a difficult road. My spouse has also been incredibly understanding and supportive. And, honestly, seeing how happy and loved my kid is has helped a lot too -- though strangely it is bittersweet: I am so pleased that my kid is doing so well and is in a happy, secure family, and yet it brings me back to how lost and alone I felt as a kid. I guess it's basically going through a grieving process -- mourning one's childhood.
OP, the best thing you could do for your kid is what you have already done: get divorced or separated from your mentally ill husband. My dad always refused to leave my mother because he thought that divorce was shameful, and the end result was that I was raised by a crazy, violent woman. (By the way I assume that your husband was granted visitation rights because he is not physically abusive or so mentally ill to the point where he would be dangerous. If my assumption is wrong, then I'd suggest you contact a family lawyer and see about getting those visitation rights revoked or drastically reduced. I think that if he is yelling or exploding at her in rage in an unpredictable fashion, then this alone may be enough reason to consult a lawyer -- emotional abuse is devastating.) I agree with the PP who said that it's a good idea to consult a professional, such as a child therapist, about how to best approach this with your child. But your kid already probably knows or senses it even if she can't articulate it-- she just doesn't have the language or the experience to be able to put this into words yet. She's still so young but if there is a way to get her to a place of compassion for her father -- "Daddy's sick. He needs help. He's getting help.", then that would probably be better than her feeling ashamed of her dad or disgusted and angry with him (both things that I distinctly recall feeling about my mother when I was young). Good luck.