Jesus inherited the right to the earthly throne of Israel through the kingly line of David, Solomon and down through Jesus* adoptive father Joseph. The genealogy of this line is given in Matthew 1:1-17. Jesus could not be the blood related descendant of David through this line since there were two men in this line who were cursed, Jehoiakim (also called Eliakim) and Jechoniah (Also called Coniah). I have been taught why only one of them is mentioned in the Matthew genealogy but I have forgotten. It may be because Jehoiakim was put on the throne by Pharaoh and therefore was not the legitimate king in God*s eyes.
2 Kings 23:34: And Pharaohnechoh made Eliakim the son of Josiah king in the room of Josiah his father, and turned his name to Jehoiakim, and took Jehoahaz away: and he came to Egypt, and died there.
Jeremiah 36:29-31: And thou shalt say to Jehoiakim king of Judah, Thus saith the LORD; Thou hast burned this roll, saying, Why hast thou written therein, saying, The king of Babylon shall certainly come and destroy this land, and shall cause to cease from thence man and beast? Therefore thus saith the LORD of Jehoiakim king of Judah; He shall have none to sit upon the throne of David: and his dead body shall be cast out in the day to the heat, and in the night to the frost. And I will punish him and his seed and his servants for their iniquity; and I will bring upon them, and upon the inhabitants of Jerusalem, and upon the men of Judah, all the evil that I have pronounced against them; but they hearkened not.
Jeremiah 22:28-30: Is this man Coniah a despised broken idol? is he a vessel wherein is no pleasure? wherefore are they cast out, he and his seed, and are cast into a land which they know not? O earth, earth, earth, hear the word of the LORD. Thus saith the LORD, Write ye this man childless, a man that shall not prosper in his days: for no man of his seed shall prosper, sitting upon the throne of David, and ruling any more in Judah.
God solved the problem of the cursed line by making Jesus a direct blood descendant of David through another line. Jesus has the right to the heavenly throne of David and is in the blood line of David through Nathan and down through Mary. This genealogy is given in Luke 3:23-38.
In verse 24 it says Joseph, which was the son of Heli, it means son-in-law. Joseph was Heli*s son-in-law. Heli was Mary*s father.
Jesus* Father is God.