Eli was the first of the line of Ithamar, fourth son of Aaron, and high priest of the temple when the Ark of the Covenant was at Shiloh. He makes his first appearance in the Bible when he overheard Hannah pray to the Lord at the Tabernacle. Thinking she was drunk, because she moved her lips without sound, he berated her, only to retract his words when Hannah told him she was praying for a child from her heart.
The child that Hannah eventually gave birth to was Samuel, whom she dedicated to the service of God, placing him in the care and custody of Eli. Samuel grew up to be a god fearing man, who loved and respected Eli. Eli was not so fortunate with his own sons, Hophni and Phinehas, who were licentious reprobates who behaved reprehensibly to the disgust of the people. Eli failed to reprove them sternly, and consequently brought upon his house the judgement of God, delivered by a messenger.
'I promised that your house and your father's house would minister before me forever.' But now the LORD declares: 'Far be it from me! Those who honor me I will honor, but those who despise me will be disdained. The time is coming when I will cut short your strength and the strength of your father's house, so that there will not be an old man in your family line and you will see distress in my dwelling. Although good will be done to Israel, in your family line there will never be an old man. Every one of you that I do not cut off from my altar will be spared only to blind your eyes with tears and to grieve your heart, and all your descendants will die in the prime of life.
(1 Samuel 2:29-33)
As God said, both his sons were killed in their prime, in a battle against the Philistines. In the same battle, the Philistines carried away the Ark of the Covenant which the Israelites had taken with them into the field without the knowledge of Eli, thinking it would help them to win. A messenger was sent to Shiloh with the news.
The man who brought the news replied, "Israel fled before the Philistines, and the army has suffered heavy losses. Also your two sons, Hophni and Phinehas, are dead, and the ark of God has been captured." When he mentioned the ark of God, Eli fell backward off his chair by the side of the gate. His neck was broken and he died, for he was an old man and heavy. He had led Israel forty years.
(1 Samuel 4:17-18)