This episode is taken from the Old Testament (Genesis 16 and 21). Abraham has a child called Ishmael by Hagar, the Egyptian maidservant of his aged and barren wife, Sara. When Sara miraculously conceives and gives birth to Isaac, she demands that Hagar and Ishmael should be banished, to which Abraham reluctantly agrees. In the wilderness their supplies run out, but an angel appears and points out a source of water to Hagar.
Guercino painted this picture for the Sienese patron Pandolfo Savini. He focuses on the sorry plight of Hagar while Ishmael sleeps in the background.