Judah and Joseph hear a prophecy from their father Jacob. He gives a messianic prophecy to Judah and his line, then gives a Messiah type prophecy to Joseph's tribe. See how this came into play around 7 A.D. where the Talmud and the Jewish historian Josephus recorded that the Sanhedrin wept and cried out in the streets of Jerusalem, "The scepter has departed from Judah but Shiloh has not come." They were sad because they thought the promised Messiah did not come according to Jacob's prophecy in Genesis 49.
You see, the Romans took the right of Judah to rule over their own people and this was the first time it had happened. Little did they know a young boy by the name of Yeshua was alive and He was Shiloh (Messiah).