"Moreover, may your house be like the house of Perez whom Tamar bore to Judah, through the offspring which the LORD will give you by this young woman." Ruth 4:12
This is the blessing spoken over Boaz by the elders of Israel when he had redeemed Ruth to be his wife. It was so that the bloodline of the tribe of Judah would continue unabated until it produced the Messiah - the Lion of the Tribe of Judah.
It is also a witness to the overarching sovereign grace of God in the affairs of men. The Father’s unswerving intention triumphs every time. “for nothing can hinder the LORD from saving by many or by few.” 1 Samuel 14:6 That is, not by quantity or by quality - but by decree.
We must never equate the Grace of God for a license to continue in sin. Indeed, Paul wrote to Titus: “For the grace of God has appeared, bringing salvation to all men, instructing us to deny ungodliness and worldly desires and to live sensibly, righteously and godly in the present age,” Titus 2:11-12
Yet, God is not constrained to accomplish His purpose by human proclivity. For do you know the back-story of the conception and birth of Perez? Illegitimacy, prostitution, seduction, incest, adultery, lying... Tamar was Judah’s twice widowed daughter-in-law who posed as a temple prostitute to get him to impregnate her. And she is one of the four mothers listed in Matthew’s genealogy of Jesus.
God will use those whom He chooses for He chooses not because they are choice, but they become choice as a result of His choosing. Election is not based on foreknowledge - foreknowledge is the outcome of election.
The steadfast love of the LORD never ceases; his mercies never come to an end; They are new every morning; Great is Your faithfulness. Lamentations 3:22-23