"Then the angel of the Lord found Hagar near a spring in the desert; it was the spring that is beside the road to Shur. And he said, 'Hagar, servant of Sarai, where have you come from, and where are you going?' 'I'm running away from my mistress Sarai,' she answered. Then the angel of the Lord told her, Go back to your mistress and submit to her.'" NIV translation
The Lord found Hagar as she was running away and told her to go back to her mistress.
We might ask ourselves why God would have her go back into such a bad situation. The answer, as we will see, is that God is not done with her and the son that she is carrying and, in fact, it is better for them to be there.
We may face some equally difficult times in our lives and wonder why God has us to remain in our situation. The answer, like that for Hagar, is that God has more to do with us where we are and it is for our own good.