I once interviewed a murderer. He was sane when he committed his appalling crimes (two murders) as a young man. But he was very badly damaged by an horrific, abusive, neglectful childhood - neglected by both his father, after his mother died, and by the state after he was taken into care.
He told me that as a homeless child (after running away from children's homes) he used to walk along the street of an evening and look into the windows where people hadn't drawn their curtains, wondering how the hell you got a home and a family. Dreaming of a home and family but having no idea how to get there, and knowing that he never would.
That doesn't excuse what he did. He didn't try to justify what he had done. He served 20+ years and says he sees his role now as trying to pay back into society and pay back the person who turned him around in prison and believed he was worth something, worth salvaging.
I have no idea whether the woman in this case has battled any demons of her own, but you don't have her sad obstetric history without being very troubled indeed. You can be sane but very damaged. That doesn't mean you aren't responsible for your actions, of course.