It's based on an incident in the history of ancient Israel, when some of its tribes beyond the Jordan built an altar. The rest of Israel concluded that this was a sign of rebellion against God, Whose worship was then centered at Shiloh. I like Eugene Peterson's The Message rendering of the passage, Jeremiah 22:10-34:
10 They arrived at Geliloth on the Jordan (touching on Canaanite land). There the Reubenites, Gadites, and the half-tribe of Manasseh built an altar on the banks of the Jordan—a huge altar!
11 The People of Israel heard of it: "What's this? The Reubenites, Gadites, and the half-tribe of Manasseh have built an altar facing the land of Canaan at Geliloth on the Jordan, across from the People of Israel!"
12-14 When the People of Israel heard this, the entire congregation mustered at Shiloh to go to war against them. They sent Phinehas son of Eleazar the priest to the Reubenites, Gadites, and the half-tribe of Manasseh (that is, to the land of Gilead). Accompanying him were ten chiefs, one chief for each of the ten tribes, each the head of his ancestral family. They represented the military divisions of Israel.
15-18 They went to the Reubenites, Gadites, and the half-tribe of Manasseh and spoke to them: "The entire congregation of God wants to know: What is this violation against the God of Israel that you have committed, turning your back on God and building your own altar—a blatant act of rebellion against God? Wasn't the crime of Peor enough for us? Why, to this day we aren't rid of it, still living with the fallout of the plague on the congregation of God! Look at you—turning your back on God! If you rebel against God today, tomorrow he'll vent his anger on all of us, the entire congregation of Israel.
19-20 "If you think the land of your possession isn't holy enough but somehow contaminated, come back over to God's possession, where God's Dwelling is set up, and take your land there, but don't rebel against God. And don't rebel against us by building your own altar apart from the Altar of our God. When Achan son of Zerah violated the holy curse, didn't anger fall on the whole congregation of Israel? He wasn't the only one to die for his sin."
21-22 The Reubenites, Gadites, and the half-tribe of Manasseh replied to the heads of the tribes of Israel:
The God of Gods is God,
The God of Gods is God!
22-23 "He knows and he'll let Israel know if this is a rebellious betrayal of God. And if it is, don't bother saving us. If we built ourselves an altar in rebellion against God, if we did it to present on it Whole-Burnt-Offerings or Grain-Offerings or to enact there sacrificial Peace-Offerings, let God decide.
24-25 "But that's not it. We did it because we cared. We were anxious lest someday your children should say to our children, 'You're not connected with God, the God of Israel! God made the Jordan a boundary between us and you. You Reubenites and Gadites have no part in God.' And then your children might cause our children to quit worshiping God.
26 "So we said to ourselves, 'Let's do something. Let's build an altar—but not for Whole-Burnt-Offerings, not for sacrifices.'
27 "We built this altar as a witness between us and you and our children coming after us, a witness to the Altar where we worship God in his Sacred Dwelling with our Whole-Burnt-Offerings and our sacrifices and our Peace-Offerings.
"This way, your children won't be able to say to our children in the future, 'You have no part in God.'
28 "We said to ourselves, 'If anyone speaks disparagingly to us or to our children in the future, we'll say: Look at this model of God's Altar which our ancestors made. It's not for Whole-Burnt-Offerings, not for sacrifices. It's a witness connecting us with you.'
29 "Rebelling against or turning our backs on God is the last thing on our minds right now. We never dreamed of building an altar for Whole-Burnt-Offerings or Grain-Offerings to rival the Altar of our God in front of his Sacred Dwelling."
30 Phinehas the priest, all the heads of the congregation, and the heads of the military divisions of Israel who were also with him heard what the Reubenites, Gadites, and the half-tribe of Manasseh had to say. They were satisfied.
31 Priest Phinehas son of Eleazar said to Reuben, Gad, and Manasseh, "Now we're convinced that God is present with us since you haven't been disloyal to God in this matter. You saved the People of Israel from God's discipline."
32-33 Then Priest Phinehas son of Eleazar left the Reubenites, Gadites, and the half-tribe of Manasseh (from Gilead) and, with the chiefs, returned to the land of Canaan to the People of Israel and gave a full report. They were pleased with the report. The People of Israel blessed God—there was no more talk of attacking and destroying the land in which the Reubenites and Gadites were living.
34 Reuben and Gad named the altar:
A Witness Between Us.
God Alone Is God.