First, indeed, this appears to be especially proper to friendship: really to converse with the friend. Now, the conversation of man with God is by contemplation of Him, just as the Apostle used to say: “Our conversation is in heaven” (Phil. 3:20). Since, therefore, the Holy Spirit makes us lovers of God, we are in consequence established by the Holy Spirit as contemplators of God. Hence, the Apostle says: “But we all beholding the glory of the Lord with open face, are transformed into the same image from glory to glory, as by the Spirit of the Lord” (2 Cor. 3:18).
It is also a property of friendship that one take delight in a friend’s presence, rejoice in his words and deeds, and find in him security against all anxieties; and so it is especially in our sorrows that we hasten to our friends for consolation. Since, then, the Holy Spirit constitutes us God’s friends, and makes Him dwell in us, and us dwell in Him (as was shown), it follows that through the Holy Spirit we have joy in God and security against all the world’s adversities and assaults. And so we read in the Psalmist: “Restore unto me the joy of your salvation and strengthen me with your lordly Spirit” (Ps. 50:14); and in Romans (14:17): “The kingdom of God is not meat and drink; but justice, and peace, and joy in the Holy Spirit”; and in Acts (9:31): “The church had peace and was edified, walking in the fear of the Lord, and was filled with the consolation of the Holy Spirit.” For this reason, too, our Lord calls the Holy Spirit the Paraclete, that is, Comforter, in John (14:26): “But the Paraclete, the Holy Spirit,” and so forth.
Similarly, too, it is proper to friendship to consent to a friend in what he wills. Of course, the will of God is set forth for us by His precepts. Therefore, it belongs to the love by which we love God that we fulfill His commandments, as the Word in John (14:15) says: “If you love Me, keep My commandments.” Hence, since we are established as God’s lovers by the Holy Spirit, by Him, too, we are in a way driven to fulfill the precepts of God, as the Apostle’s word goes: “Whosoever are led by the Spirit of God, they are the sons of God” (Rom. 8:14).
Thomas Aquinas, Summa Contra Gentiles, Book IV, Chapter 22.