There's a surprising situation that leads to God making his covenant with King David (the story is found in 2 Samuel 7 and repeated in 1 Chronicles 17). David has finished building his house and is now living in luxury and comfort. Things have gone very well for David—he is reaping the benefits of God's blessing in his life. At this point in his life, David thinks that it is time to give back. It is time for him to do something for God.
So David comes up with an idea: he will build a house for God, he will build the temple. Up to this point, God did not have a permanent house. Worship still took place in a temporary structure, a tent, the tabernacle. David's idea was to take care of this problem for God once and for all. How noble of David, how generous, how admirable. He even runs the idea by the prophet Nathan to double-check his idea, and Nathan tells him to go for it. Everyone agrees that this is a great idea. How kind of David to build a house for God. But God would have none of it.
The word of the Lord came to Nathan that night to correct the bad advice he had given to David. God asks, "Would you build me a house to dwell in?" And after recounting the way that God has taken David from following the sheep out in the pasture to make him king, God promises, "Moreover, the LORD declares to you that the LORD will make you a house" (2 Samuel 7:5-11). God's covenant to David is to make him a house, that is, a royal line that will sit on the throne of his kingdom forever (2 Samuel 7:13-16, which is ultimately fulfilled in Jesus). David offers to build God a house, but God stops him by saying, "No, I will build you a house." David would not build a house for God; instead God would build a house for David. God steps in to stop David because David had things backwards.
One of the biggest misunderstandings that people have about God is that he wants us to work for him. As in, God has stuff that he wants to get done, and he is dependent upon us to do it for him. We think that it is therefore a sign of goodness to serve God and use our time and efforts to help him out a bit. After all, how spiritual of us, how decent, how upright. We may even pat ourselves on the back for the good that we have done. But God is not interested in this in the least bit.
The Bible is not instructions for what we should do for God. Instead God's message in the Bible, from beginning to end, focuses on what he does for us. God is not a helpless has-been looking for benefactors. He is the Almighty Father who provides for his children. In fact, Acts 17:25 clearly tells us that God is not "served by human hands, as though he needed anything, since he himself gives to all mankind life and breath and everything." He is not dependent on people who will work for him (which would earn wages). Instead he is looking for empty-handed people, people who have done nothing for him, who will come to him for grace (if you don't believe me, read Romans 4:1-5).
The whole point of grace is that God works for our good. Throughout the Bible, God repeatedly places the emphasis on what he does for his people. God saved Noah and his family from the flood because Noah found favor (or grace) in the eyes of the Lord (Genesis 6:8). When Jacob's family was on the verge of starvation, his son, Joseph, realizes that God had sent him to Egypt to preserve their lives (Genesis 45:5). When the people were slaves in Egypt, God promises, "I will bring you out from under the burdens of the Egyptians, and I will deliver you from slavery to them, and I will redeem you with an outstretched arm" (Exodus 6:6). When God's people were in exile in Babylon, he promised that he would bring them back to their own land (Ezekiel 37:21). When we need deep transformation, God promises, "I will give you a new heart, and a new spirit I will put within you" (Ezekiel 36:26). And when we need a savior, he sent us Jesus. Paul even places his sure hope for our persevering faith in the Lord: "And I am sure of this, that he who began a good work in you will bring it to completion at the day of Jesus Christ" (Philippians 1:6). God doesn't need us to work for him, but we surely need him to work for us.
So how does David respond when God sets him straight? David says, "Who am I, O Lord God, and what is my house, that you have brought me thus far? . . . . You are great, O Lord God. For there is none like you, and there is no God besides you" (2 Samuel 7:18 and 22). David responds with humility (in himself) and worship (in the Lord). That's really the whole, two-sided purpose of grace. Further, he recognizes that God is "making himself a name" by "doing for them great and awesome things" (2 Samuel 7:23). If we work for God and help him out, we get the credit. But if God graciously works for us, he gets the credit. The giver (or Giver) gets the glory. God is not looking for people who can work for him; he is looking for people who will let him work for them. As we read in Isaiah 64:4, "From of old no one has heard or perceived by the ear, no eye has seen a God besides you, who acts for those who wait for him." How great is that!