When Jeremiah began to prophesy about the apostasy of Judah and its future captivity, he received death threats from the people in his hometown of Anathoth. Jeremiah complained to God about this persecution and this verse is the beginning of God’s response to Jeremiah.
“He said, ‘I will cause all My goodness to pass in front of you, and I will proclaim the name Yahweh before you. I will be gracious to whom I will be gracious, and I will have compassion on whom I will have compassion'” (Exodus 33:19, HCSB).
God spoke these words to Moses in response to his request that God show Himself–His glory–to Moses. Moses made this request because he was concerned that Israel’s standing with God was in question.