Why do Matthew and Luke show different genealogies for Jesus?
A common explanation of the genealogies is that Matthew provides the legal descent through Joseph, Jesus’ legal father, and Luke provides Jesus’ physical descent through Mary. With Joseph as his legal father, Jesus was David’s legal descendant. Romans 1:3 attests to that. Luke traces Jesus’ family line through Mary, and the evangelist demonstrates that Jesus is connected to Adam and Eve (Genesis 3:15).
Jesus, the eternal Son of God, did not appear out of thin air when he entered this world to fulfill the promises of the Savior. No, there was a lineage and ancestry that could be traced. As you noted, Scripture even provides two genealogies.