In a remarkable scene at the end of David's life, the sweet singer of Israel reflects on his life and his hope for the future. We can well understand that David would be concerned for the future well-being of his line. But he looks with confidence on the assurance of God's covenant: "For does not my house stand so with God? For he has made with me an everlasting covenant, ordered in all things and secure" (2 Sam. 23:5).
How significant that David would speak of God's covenant being secure because it is "ordered." Covenant theology is sometimes maligned as overly focused on legal arrangements. But David rejoices that it is so! God pledges himself by stipulations that, when fulfilled, provide what the writer of Hebrews called "a sure and steadfast anchor of the soul" (Heb.6:19). The Christian can thus rejoice in the covenant of grace. It has conditions that must be fulfilled by God through the work of his Son, Jesus Christ. Jesus must "fulfill all righteousness" (Mt. 3:15) by his perfect law-keeping life. He must also make atonement for the sins of his people through the blood of his cross (Lk. 22:20). These stipulations were perfectly fulfilled by our Savior. But there is a condition to be fulfilled on the side of the sinner, namely, faith in Christ and his work. This, too, God fulfills through the gift of faith and the regenerating work of the Holy Spirit (Eph. 2:8). The result is that the Christian, with Spirit-wrought faith and looking to the perfect fulfillment of Christ, may join David in rejoicing that all things for his salvation are ordered and secure.
In a careful study of this passage, the great Puritan John Owen enumerated three reasons why believers should rest secure in God's covenant of grace and thus refuse to trust in anything of this world or any merit in ourselves. First, Owen pointed out who is the author of this covenant: "Why, it is the Rock of Israel, the God of Israel - He hath made it. It is not a covenant that man made with me, nor an angel; but it is a covenant that God hath made with me." Second, David describes it as an "everlasting covenant" (2 Sam. 23:5). It is, Owen comments, "everlasting in respect of the beginning of it; it is a covenant that comes from everlasting love, 'I have loved thee with an everlasting love... Therefore with loving-kindness have I drawn thee' (Jer. 31:3)." Moreover, "it is everlasting in respect of the end of it: it ceases not until it brings the whole person, soul and body, into everlasting glory." Third, Owen teaches, the covenant is ordered and sure not only in that the conditions are fulfilled but also as it is also sealed by the oath of God and supported by the never-ending intercession of Christ in heaven. Owen writes: "He is made the surety of a better covenant. And he lives for ever to make intercession for them that come unto God by him, and so is able to save to the uttermost (Heb. 7:22, 25)."
David reflected on the ordered certainty of God's covenant fulfillment, urging all who hear to enter in through faith. For his own cause, he faces death with supreme confidence: "For will he not cause to prosper all my help and my desire?" (2 Sam. 23:5). But he is equally certain of the condemnation of sinners who persist in unbelief: "But worthless men are all like thorns that are thrown away, for they cannot be taken with the hand; but the man who touches them arms himself with iron and the shaft of a spear, and they are utterly consumed with fire (2 Sam. 23:6-7). David is thinking of the way an iron tool is used to grasp thrown bushes and cast them into a consuming fire. How certain is God's wrath, ordered and secure, for those who will not believe on Jesus Christ! Secure in his own future, even in his death, David warns everyone to prepare to meet the final judgement. There is absolute security in the day of wrath through faith in the blood of Christ, which "cleanses us from all sin" (1 Jn. 1:7). But only faith in Jesus can benefit from God's only way of salvation, the covenant of grace. Only its ordered and secure covenant arrangement can "deliver us from the wrath to come" (1 Thess. 1:10).
 John Owen, "The Everlasting Covenant: The Believer's Support Under Distress," in The Works of John Owen, 23 vols. (Edinburgh: Banner of Truth, reprint 1965), 9:416-19.