In Theophanies and the Law
This divine pedagogy appears especially in the gift of the Law. God gave the letter of the Law as a "pedagogue" to lead his people towards Christ. But the Law's powerlessness to save man deprived of the divine "likeness," along with the growing awareness of sin that it imparts, enkindles a desire for the Holy Spirit. The lamentations of the Psalms bear witness to this.
Source: Catechism of the Catholic Church (Vatican.va)