Before Creation, God the Father and God the Son had a covenant (pact). They agreed to redeem fallen man from his sin and to reestablish him to a right relationship with God.

God the Father commissioned the Son to be the Mediator (the second Adam) between God and man, to give His life for the Salvation of the world. In accepting this, Jesus promised to obey the Father and to righteously (without sin) do the work that God the Father had set before Him, by perfectly obeying the Law of God.

So, before the Foundation of the World, God determined that the world would not be destroyed by sin (this is God’s grace), and that Christ would be the Savior of the world.