Covenant Theology is a comprehensive framework that structures all of redemptive history from eternity past to eternity future. Within this framework, three basic covenants exist: the Covenant of Redemption, the Covenant of Works, and the Covenant of Grace. These covenants are closely interconnected, yet each one is distinct.
The most fundamental of these covenants is the Covenant of Redemption, which refers to the inter-trinitarian pact made in eternity past. In this covenant, the Father designed the plan of redemption, the Son agreed to undertake the work of redemption, and the Spirit agreed to apply the results of redemption to the elect. Every person whom Christ would redeem and whom he would be given as the reward for his sufferings was chosen by the Father before the creation of the world. This covenant serves as the foundation for all subsequent covenants and provides the basis for the work of salvation.
"Blessed be the God and Father of our Lord Jesus Christ, who has blessed us in Christ with every spiritual blessing in the heavenly places, even as he chose us in him before the foundation of the world, that we should be holy and blameless before him. In love he predestined us for adoption to himself as sons through Jesus Christ, according to the purpose of his will" (Ephesians 1:3-5 ESV).
'Father, the hour has come; glorify your Son that the Son may glorify you, since you have given him authority over all flesh, to give eternal life to all whom you have given him. (John 17:1-2 ESV).
"Father, I desire that they also, whom you have given me, may be with me where I am, to see my glory that you have given me because you loved me before the foundation of the world" (John 17:24 ESV).
The Covenant of Works is related to the Covenant of Redemption in that it sets the stage for the work that the Son undertook to accomplish. This covenant gives the terms of what the Son would have to do in the pursuance of the redemption that he had covenanted with the Father to provide for his people. In this covenant, the Father lays certain stipulations upon man, his climactic creature formed in his image, with the promise of eternal life in his most blessed presence as the outcome of successfully fulfilling his terms. If Christ would accomplish what the Covenant of Redemption requires of him, then, he must fulfill the terms of the Covenant of Works perfectly. He must do so as a man and as the federal head or representative of the people he had covenanted to save.
"And the Lord God commanded the man, saying, 'You may surely eat of every tree of the garden, but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die'" (Genesis 2:16-17 ESV).
"Do this and you will live" (Luke 10:28 ESV).
"For Moses writes about the righteousness that is based on the law, that the person who does the commandments shall live by them" (Romans 10:5 ESV).
The Covenant of Grace is closely related to the Covenant of Works, as it is basically a republication of that Covenant, promising the same end of eternal life in God's presence on the condition of the perfect fulfillment of God's commands. However, it has an added proviso: because Adam, the first federal head of the human race, failed to keep the terms of the covenant, God freely promised to send a new federal head, the Christ, to do what Adam had failed to do and to win the rewards of the covenant that Adam had broken. In the Covenant of Grace, God unilaterally promises the reward of his eternal, favorable presence, and he pledges by his own person and at his own expense to do so. This may be seen in the animal he provided and killed to clothe Adam's shame, in the bow drawn back against himself after Noah's flood, in his walking alone through the severed animal halves before Abraham, and ultimately in Christ, who underwent the covenant curses for us who had merited them in Adam and won for us as our new federal head, by a life of perfect obedience, all the covenant blessings.
"I will put enmity between you and the woman, and between your offspring and her offspring; he shall bruise your head, and you shall bruise his heel" (Genesis 3:15 ESV).
"And the Lord God made for Adam and for his wife garments of skins and clothed them" (Genesis 3:21 ESV).
"And I will establish my covenant between me and you and your offspring after you throughout their generations for an everlasting covenant, to be God to you and to your offspring after you" (Genesis 17:7 ESV).
"Behold, the days are coming, declares the Lord, when I will make a new covenant with the house of Israel and the house of Judah" (Jeremiah 31:31 ESV).
"But when Christ appeared as a high priest of the good things that have come, then through the greater and more perfect tent (not made with hands, that is, not of this creation) he entered once for all into the holy places, not by means of the blood of goats and calves but by means of his own blood, thus securing an eternal redemption" (Hebrews 9:11-12 ESV).
"For as by the one man's disobedience the many were made sinners, so by the one man's obedience the many will be made righteous" (Romans 5:19 ESV).
"This cup that is poured out for you is the new covenant in my blood" (Luke 22:20 ESV).
All the historical covenants mentioned in the scriptures are organically-connected expressions or administrations of the Covenant of Grace. The covenantal relationship between God and his people, first established in the Garden of Eden, is maintained and developed throughout redemptive history through the various administrations of the Covenant of Grace. As such, the Covenant of Grace is the overarching covenant that provides the framework for God's plan of salvation and the ultimate goal of all redemptive history.
A very good book that discussed these covenants in much more detail is "Of the Covenant Bonds of Religious Connection Between God and Men" by John Brown of Haddington. Link in comments.