Matthew opens his account with a presentation of the book of the generation of Jesus Christ. Beginning with Abraham he traces the lineage to Joseph, the husband of Mary. The purpose of this genealogy was apparent to any Jew, for the Messiah must be of the seed of David, and without documentary proof to this end no one could hope to claim recognition that was due the Son of David.
A careful examination of the genealogies will reveal that the lineage is selective, not necessarily presenting every name that is properly in the line. As itemized by Matthew, fourteen generations are mentioned from Abraham to David, fourteen generations from David to the Babylonian Captivity, and then fourteen from the Captivity to Christ. Notable omissions are the names of three kings mentioned in 1 Chronicles 3:11-12 (Ahaziah, Joash, and Amaziah). The obvious reason for the omission seems to be to maintain the unity of fourteen generations in each section.
The names recorded in Matthew 1:13-15 are New Testament additions and are not found in the Old Testament. These names were taken from available registers of the families at the time of Christ.
In contrast to Matthew, Luke traces the genealogy to Adam. Many believe there are omissions in the line from Adam to Abraham. There is the problem of variation in Luke as compared to Matthew and the Old Testament. In Genesis 11:12 there is an omission of Cainan, recorded in Luke 3:36. Omissions in genealogy are common, however, as illustrated in the Old Testament omissions found in Ezra 7:1-5 where six generations of the priesthood are left out.
It should be clear that genealogies are not necessarily complete, the main point being legitimate descent rather than inclusion of all the links in the genealogy.
The principal problem of Luke's genealogy, however, is that an entirely different lineage is presented from David to Joseph, the descent coming from Nathan, David's son, rather than through Solomon as in Matthew's account. The most common explanation of this seems to be the best-that is, that Joseph as the son-in-law of Eli was considered in the descent from Eli through his marriage with Mary and that the lineage therefore is that of Mary rather than of Joseph.
This fits in beautifully with the Old Testament predictions given through Jeremiah (cf. Jer 22:30; 36:30) to the effect that the line of Coniah would never have a man to sit on the throne. Though the legal right to the throne passed from Christ through Joseph as His legal father, the actual physical lineage could not come through Joseph because of this curse on his line. Luke therefore traces the physical lineage of Christ through Mary back to Adam the first man, connecting Christ to the predicted seed of the woman.