God is speaking about the two nations, Israel and Judah. Israel had gone into captivity over a hundred years before Jeremiah came along. God is relating what Judah did after it saw that Israel had gone into captivity for its sins.
He uses marriage as an analogy of His relationship with His people—first with Israel and Judah and later with the church—in order to help us see clearly what is required of us. He calls Israel His wife, but Israel was not faithful in that the people committed idolatry. God considers this spiritual idolatry as being the same as, or similar to, the committing of adultery in a human marriage.
This is why He calls idolatry "adultery." It is unfaithfulness to a vow, a contract, a covenant, or an agreement. The two partners in the agreement, God and Israel, said, "I do" to be Husband and wife. God was faithful, upholding His part of that relationship, but Israel was unfaithful to those vows, committing adultery through idolatry, by worshiping other gods.
Notice how strong God's language is: He uses the word "treacherous." He calls Judah's unfaithfulness, her idolatry, her spiritual adultery "treachery." It is a word that is reserved for the most despicable breaches of trust. We do not like to use it even when speaking of adultery, so we soften it, using a euphemism like saying he or she "had an affair." God calls it what it is—treachery, an egregious violation of allegiance, of trust.
Whether a person is treacherous, that is, unfaithful, or whether he is faithful to his vows, both results have to be worked at, but the former comes easier than the latter because treachery follows the natural course of human nature. We have all done what Israel and Judea did through sin, alienating ourselves from Him.
God does with us individually as He was willing to do with Israel and Judah as nations. He says, "Yes, you've committed these unfaithful sins, but if you'll just return to Me, I'll still accept you as my wife." He is willing to forgive. The condition, however, is repentance—real change in attitude and behavior.