Firstly, Matthew states that Joseph the betrothed is the son of Jacob (Matt. 1:16), while Luke attributes this lineage to Eli (Luke 3:23). Secondly, the genealogies present Salathiel and Zerubbabel with differing fathers and sons. Matthew lists Salathiel as the son of Jechoniah (Matt. 1:12) and Zerubbabel as the son of Abiud (Matt. 1:13), whereas Luke identifies Salathiel as the son of Neriah (Luke 3:27) and Zerubbabel as the son of Risaiah (Luke 3:27).
Thirdly, Matthew’s genealogy traces Joseph's lineage back to David through Solomon (Matt. 1:6-7), whilst Luke traces it through Nathan (Luke 3:31). Fourthly, the names recorded from David to Salathiel (Matt. 1:7-12; Luke 3:31-27) and from Zerubbabel to Joseph (Matt. 1:13-16; Luke 3:27-23) differ greatly in both lists, and the total counts of ancestors are not equivalent.
The interpretations for these discrepancies include the following: one view is that Matthew provides the genealogy of Joseph, while Luke offers that of the Virgin Mary, both descending from David through different ancestral lines. However, this contradicts Luke's explicit declaration that he also tracks Joseph’s lineage (v. 23). Additionally, it was uncommon to list genealogies through the female lineage, even though it is accepted that Mary too descended from David.
Another perspective is that the individuals listed in both genealogies represent the same people, but their names differ due to the Jewish practice of individuals having multiple names. Yet, this hypothesis does not align with the evident differences in the genealogies indicating that one lineage descends from David through Solomon and another through Nathan, and contradicts the variance in the number of people in both lists.
A compelling explanation for the differences is based on the law regarding succession, which specified that a brother or nearest relation of a deceased man without heirs would marry the widow and continue the family line (cf. note on Matt. 1:12). The offspring born of such a union therefore had two fathers: one by blood and the other by law. Thus, Matthew refers to Salathiel as the son of Jechoniah (according to the law), while Luke names Neriah as his biological father, who reestablished the lineage of the childless Jechoniah.
From Zerubbabel, who was adopted by Salathiel, came Abiud and Risaiah. Matthew traces his genealogy through Abiud while Luke does so through Risaiah, parallel to how Matthew describes David's lineage through Solomon and Luke through Nathan. Ultimately, both genealogies link to Jacob and Eli, both named as fathers of Joseph the betrothed. Jacob, being the direct descendant of Matthat who died childless, ensured the continuation of the line through his widow by fathering Joseph, who was therefore considered the son of Jacob in the flesh and Eli in a legal sense.
This explanation of the genealogical differences can be traced back to the 2nd century writer Julius Africanus, who reportedly learned it from the surviving family of the Blessed Virgin (Euseb. Church Hist. 1, 7). This perspective has been deemed the most plausible and embraced by many Church fathers and scholars. The application of the law of succession would have likely occurred during the times of strife for the house of David, such as during the Babylonian exile and prior to the advent of Christ, when David's lineage was no longer ruling in Jerusalem.