The friendship of the Lord is for those who fear him, and he makes his covenant known to them.From what I can tell, the Hebrew word ס֣וֹד on its own is never translated as friendship. Its most common translation is secret, but here I think counsel also works. Some would even say, "The secret counsel of the Lord..." which, of course, would have had John Calvin dancing for joy. For example, look at my paraphrase of this sentence from his Institutes 3.17.1 (I have not changed the expression "secret counsel" here):
While our hardships should always remind us of our sins, so that pain may encourage us to turn our lives around, we also see how Christ tells us that there's more to the secret counsel of God than simply punishing people as they deserve.In other words, though common sense might tell us that it's strictly a matter of getting what we deserve, God's actual plan allows for the workings of grace.
I doubt Calvin here was trying to reïterate Psalm 25:14, but he might as well have been. For the psalm verse tells us that the "secret counsel" of God is for those who hold God in reverence, and it's to such as these that God reveals the covenant of grace.
And so when, even from a distance, we perceive the meaning or the workings of grace, we should rejoice that God is somehow confiding in us that there's something more in store for us, even if we're told we deserve less. This reminds me of one of my favorite quotations: "The Spirit of the Lord makes not a noise, but comes in a still small voice, and makes a soft and secret report to the soul that it is beloved, that it is pardoned, and that it shall be forever glorified." (Thomas Brooks)