Why do the genealogies of Christ differ?
There are two genealogies of Christ in the Bible. One in Matt. 1:1-17, the other in Luke 3:23-28. The purpose of the genealogies is to show that Jesus is the promised Messiah, and that that which had been prophesied about the lineage of the Messiah was fulfilled in Him.
Matthew wrote his Gospel primarily for Jews. The Jews were descendants of Abraham. Thus Matthew begins his genealogy of Christ from him and in this way shows that Jesus is the Seed promised to Abraham, and the Savior of the Jews.
Luke on the other hand writes primarily to gentile Christians. He does not therefore in his genealogy stop at Abraham, but goes all the way back to Adam and God. In this way he shows that all people, both Jews and Gentiles, are descendants of Adam and are all the creations of the same God. Because Jesus can be traced back to the very beginning, He is the Savior of the whole world.
The genealogies show Jesus to be a true human being, our brother, who is of the same flesh, bones and blood as we are. Jesus' birth of a virgin through the power of the Holy Spirit, which both Matthew and Luke mention, proves that He is the Son of God.
The genealogies of Matthew and Luke differ from each other during the time from Joseph to David.
Matthew's genealogy continues: "To Jacob was born Joseph the husband of Mary, by whom was born Jesus, who is called Christ." Matthew uses the expression "to Jacob was born Joseph", which indicates that Jacob was the real father of Joseph. This genealogy follows the succession of the ruling authority of the House of David, and shows that Jesus was the legal successor to the throne of David. The prophecies had been fulfilled. The Jews studied the genealogies diligently and they had to admit this.
Luke's genealogy travels a different road from Joseph to David. "Joseph (was) the son of Eli... the son of Nathan, the son of David." Luke does not in the manner of Matthew use the words "was born". The choice of words is intentional. Luke does not mention Eli as the natural father of Joseph. From the writings of the Jews we know that Eli was the father of the Virgin Mary. Luke's Gospel therefore also includes the genealogy of Mary and shows that Jesus was the descendant of David also according to the flesh.
But why does Luke call Joseph the son of Eli? Joseph was the son-in-law of Eli. In some instances the son-in-law was called the son of the father-in-law (Neh. 7:63), especially if the father-in-law had no male descendants and a daughter was the inheritor (Numbers 27:1-11).
The church father Epifanios (315-403) already explained this passage in this way.