One of the reasons why most Jews do not believe that Jesus of Nazareth was — or is — the long-prophesied Messiah is their contention that Jesus was not descended from King Solomon. True, the genealogy of Jesus as recorded in Matthew 1:1-16 traces him back to King Solomon (see especially Verses 6 and 7). However, this genealogy is that of Joseph — Mary’s husband, who was not the biological father of Jesus at all.
As Verses 18-20 continue with the story, Mary had become pregnant with the child Jesus by the Holy Spirit before she and Joseph had sexual relations. Luke 1:35 testifies that the Holy Spirit came upon Mary, and through that power she bore Jesus who is called here “the Holy One” and “the Son of God.” Thus Matthew’s genealogy of Jesus has been considered His “legal” genealogy, Joseph having become His “stepfather” of some sort.