Mary Maloney is a happy, contented woman who feels secure and confident in her life. Roald Dahl describes,
"There was a slow smiling air about her, and about everything she did."
She has a husband that she loves, a routine that she can trust and count on, and joy in the coming baby. She feels this way because as long as she has been married, the routine has been the same, and she takes comfort in it. She figures that if that routine exists, all must be well. She takes the routine as evidence of her happy life and marriage. So, imagine that you were perfectly content, and confident in the happy life that you lead, and the person you love and worship most in the world, drops a bomb on you by saying they don't love you anymore and are leaving you. Leaving you, and the baby, to be abandoned and dejected. This would be totally unexpected, and a complete shock. So shocking in fact, that it might jar you right out of your normal personality, and bring forth your survival instincts. Mary reacts without thinking, from the shock, and ends up with a dead husband on her hands. She realizes what she has done, and is willing to accept the consequences, but, she worries about the child:
"As the wife of a detective, she knew quite well what the penalty would be. That was fine. It made no difference to her. In fact, it would be a relief. On the other hand, what about the child? "
So, she uses what she has learned from being a detective's wife, and sets up the perfect escape from the crime. She, in defense of her child, does what she has to do. So, she changes from a rather passive, contented woman to an active woman who takes charge to protect her own, and the circumstances are what prompted that change. I hope those thoughts help; good luck!