In 2 Samuel 7, verses 11-14, God speaks to the prophet Nathan about King David:
The LORD declares to you that the LORD himself will establish a house for you: When your days are over and you rest with your fathers, I will raise up your offspring to succeed you, who will come from your own body, and I will establish his kingdom. He is the one who will build a house for my Name, and I will establish the throne of his kingdom forever. I will be his father, and he will be my son.
The New Testament writers certainly believed that these promises to David applied to Jesus. But why?
First, The NT writers recognized Jesus as a physical descendant of David (see Matt 1:1; Acts 13:22–23; Rom 1:3; 2 Tim 2:8; Rev 22:16). Second, God did indeed “raise up” Jesus when He resurrected Him from the dead. Third, Jesus claimed He would build a temple (see Matt 26:61; 27:40; Mark 14:58; 15:29; John 2:19–22). Fourth, Jesus claimed to possess an eternal throne and an imperishable kingdom (see Matt 19:28–29; Luke 22:29–30; John 18:36).
Fifth, Jesus’s disciples understood Him to be the literal Son of God. Robert Bergen, in 1, 2 Samuel: An Exegetical and Theological Exposition of Holy Scripture (The New American Commentary), writes,
Jesus is unambiguously understood in the New Testament to be the Son of God (Mark 1:1; John 20:31; Acts 9:20; Heb 1:5), an understanding fostered by Jesus’ own self-claims (cf. Matt 27:43; Luke 22:70). In taking this verse literally and applying it to Jesus, the New Testament connected it with Jesus’ virgin birth (cf. Luke 1:32).
Taken together, it is easy to see how the New Testament writers believed Jesus to be the fulfillment of the promises made to David in 2 Samuel 7. Jesus certainly thought of Himself as David’s successor and provided evidence that He was in a number of ways.