Joshua 4:3
And command ye them, saying, Take you hence out of the midst of Jordan, out of the place where the priests’ feet stood firm, twelve stones, and ye shall carry them over with you, and leave them in the lodging place, where ye shall lodge this night.
The command was divine direction given through Israel's invisible Leader to Joshua after the people had crossed over on dry ground. It required taking twelve stones from out of the midst of the Jordan, from the very riverbed out of the place where the priests' feet had stood firm, carrying them over with Israel, and leaving them in the lodging place where they would lodge that night. The work was appointed to twelve men, one from each tribe as representatives of the whole of Israel, each man taking up and carrying a stone.
They were to bear the stones across to the western side to the camp for that night, identified as Gilgal, Israel's first encampment in the promised land, where Joshua set them up as a monument. That monument preserves the memory that God by His own power brought Israel into the promised land across the Jordan on dry ground, when the waters of the Jordan were cut off before the ark of the covenant, a miraculous deliverance. It stands as a lasting reminder of Israel's passage into the promised land and keeps the lessons of God's dealings with His people in memory.
It was to serve as a lasting visible memorial of God's power and deliverance and of His providential care and mercy, teaching spiritual truth and making Israel's history a lesson for later generations. By remembrance of the miracle faith was to be strengthened, and future generations were to learn that His power is mighty and that He is to be revered. When children should ask about the stones, the story of the crossing was to be repeated so the miracle would be remembered. In this way the stones were to preserve for those to come the memory that the Jordan's waters were cut off before the ark of the Lord's covenant as Israel crossed.
The twelve stones represent the twelve tribes descended from Jacob, in connection with the crossing into the promised land and the covenant the Lord made with Israel. That covenant meaning was later honored when Elijah rebuilt the altar with twelve stones, showing respect for the covenant.