It depends upon our co-operation. We are not subject to God's will mechanically, like a robot, automatically doing what we are programmed to do under specific instructions. In co-operation with God, we retain our own will power and may choose at any time to act differently. That is important, because sometimes people are deceived into thinking that religious commitment destroys a person's powers of rational thought, discernment, responsibility and freedom. Religion is not the same thing as faith in God.
Religion can be bad as well as good.
That is how it was with Mary, and God's ways with us are the same though we may be called to more humble tasks than she was. She did not always understand, and sometimes she was mistaken. Her will was not always in accord with the will of God. But, what can said for her is that in spite her lack of understanding, she remained loyal to him. Mary was one of the few who was still there at the end as he was dying on the cross.