The apostle Paul introduces an interesting allegory, in which the covenants are likened to Hagar and Sarah, both of whom bore children to Abraham. The purpose of the legalistic covenant was to keep God's people under surveillance and strict control in order to bring them to Christ. The coming of Christ was designed to bring man into a completely new relationship with God, a relationship of faith. The type of relationship that was instituted through Moses stands in stark contrast to that which came through Christ. There is as much difference between the relationship that was previously enforced and that which we now enjoy with God, as there is between a legal code and undeserved kindness.
All law is a restraining and restrictive influence.
Law is intended to define boundaries, to restrict liberties, and to provide penalties. Under law man is really under guard. The ultimate purpose was to deliver God's people to Christ. In Christ a custodian is no longer needed. The glorious covenantal relationship now sustained is not based upon a written code at all.