What does Ruth 4:18 mean?
The story about Ruth is primarily about God's faithfulness to Naomi, but it ends with God's faithfulness to Israel in providing King David. The last few verses show how Ruth and Naomi fit in the genealogy of David.This genealogy begins with Perez. Abraham had Isaac; Isaac had Esau and Jacob; Jacob had twelve sons and one daughter. Jacob's fourth son was Judah. Because of the sins of Judah's three older brothers, Jacob prophesied that Judah would reign over the whole family (Genesis 49:3–12).
Judah married a Canaanite woman and had three sons: Er, Onan, and Shelah (Genesis 38:1–5). When Er was grown, he married Tamar, who may also have been a Canaanite (Genesis 38:6). Er "was wicked in the sight of the LORD" and God killed him (Genesis 38:7). The custom of the time, later ratified into the Mosaic law (Deuteronomy 25:5–6), was if a married man died with no heir, his next-youngest brother would marry the widow and provide a son in the dead man's name. To that end, Tamar was married to Onan. Onan used Tamar but he refused to give her a son, so God killed him, as well (Genesis 38:8–10).
The loss of his two sons scared Judah. When Shelah came of age, he refused to marry him to Tamar. Tamar had the right to marry Shelah and bear a son for both Er and herself. After Judah's wife died, Tamar disguised herself as a prostitute and waited for Judah to pass by. He had no money to pay her, so he gave her his signet, cord, and staff as collateral. When he heard that Tamar was pregnant, he demanded she be executed for adultery. But when she appeared with his identifying possessions, he declared that she had acted more righteously than he had (Genesis 38:11–26).
Several months later, Tamar gave birth to twins: Perez and Zerah (Genesis 38:27–30). Perez fathered Hezron and Hamul (1 Chronicles 2:5). Judah, Shelah, Zerah, Perez, and Perez's sons all traveled from Canaan to Egypt (Genesis 46:12). From here, the line continues to David.