therefore also I have granted him to Yahweh; as long as he lives he is granted to Yahweh. He worshiped Yahweh there.
So the scene is set the man living in polygamy, two wives. One he loved more than the other. One had many children, but the one he really loved could not have any children.