1 Samuel 1:2

And he had two wives; the name of the one was Hannah, and the name of the other Peninnah: and Peninnah had children, but Hannah had no children.

Elkanah, a Levite, had two wives, Hannah and Peninnah, with Peninnah having children while Hannah had none. He had taken Peninnah as a second wife when Hannah bore no children, seeking to preserve his name. That course arose from lack of faith and was not sanctioned by God. It broke the peace of what had previously been a harmonious household.

Hannah was a consecrated woman who felt deep grief over her childlessness. As children were added to Peninnah, she became proud and self-important. She taunted Hannah over her childlessness as evidence of the Lord's displeasure, treating her with contempt and insolence.

Elkanah showed his affection for Hannah despite her having no son by giving her a double portion. He went with his family to worship and sacrifice at Shiloh, at a time when worship there had become irregular and incomplete. This childless state sets the context for Hannah's prayer and for her later thanksgiving when God answered her request.