Jacob's children are gathered to hear who will lead the family as Jacob is nearing the end of his life. They expected the eldest would be chosen, however with God's guiding Judah (the fourth eldest) was the one despite his previous failings.
God had been transforming Judah's heart and over time he began to take responsibility for his actions. Judah was willing to offer his life for his family and was behaving as a leader.
Character, skill and calling come together to form this choice. Sin is to be taken seriously (the 3 other elder son's weee disqualified from leading because of their sin), but it isn't the last word (God was working in Judah's life to redeem him for this work. God's grace and mercy can restore the sinner).
Jacob is seeing far into the future and prophesied great kings from Judah. Judah's mother named gave him his name to praise God, and others will praise God because of Judah. Jacob does warn there will be opposition in the future, but gives encouragement that they will overcome (see King David's life).
Jacob says that Judah's tribe would exist and rule until the Messiah comes from them. The Messiah will inherit rulership over everyone. The Romans destroyed the genealogies and took power over Is real in the time of when Jesus came. Revelation 5 shows the praise for the Messiah for overcoming sin amd death.
Jacob forsees a day where there will be an unbelievable abundance.