During the forty years that the Jewish People spent in the desert before entering the Land of Israel, the encampment of the twelve tribes followed a fixed order. The tribes were divided into four sets of three tribes each, and they surrounded the Mishkan which represented the central heart of the nation. Each group of three had its own distinct banner; there was not an individual banner for each of the tribes. The most honored position was to the east, led by the tribe of Yehuda and accompanied by the tribes of Yissachar and Zevulun. Next in importance was the south, led by the tribe of Reuven and accompanied by Shimon and Gad. Next was the west, led by the tribe of Ephraim and accompanied by Menashe and Binyamin. Finally, the north, led by the tribe of Dan and accompanied by the tribes of Asher and Naftali.
The configuration of the tribes requires explanation. Since Leah had six children, we would have thought that they should have comprised two of the encampments. Another should have gone to the children of Rachel and another to the children of the maidservants. However, since the tribe of Levi, which was dedicated to the service in the Mishkan, did not have a particular spot, it was replaced by Gad who was the oldest of the sons of Leah’s maidservant. Since Yehuda represented royalty, he was given the pre-eminent position, with his younger full-brothers under him. His brother Shimon could not serve under him as he was older. It was also fitting that Yissaschar accompany Yehuda, as the members of that tribe were noted for their wisdom, especially in terms of astronomical calculations which would be useful to rulers. Rachel’s children comprised the entirety of one encampment (Ephraim and Menashe representing Yosef) and the three remaining sons of the maidservants, led by Dan, comprised the entirety of the final camp. Dan led the last camp based on his strength, as indicated by the verse in reference to him, “Dan will be a serpent on the highway, a viper by the path…” (Ber. 49:17)
Even though the census of each tribe was enumerated at the beginning of the Torah portion, the sum total of each group of three is listed again when the groups are delineated in chapter two. This repetition has significance for possible future military confrontations. When the nation moved on to a new site in the desert they were led by the banner of Yehuda, which had the largest number of military-aged males. Next in line were the banners of Reuven and Ephraim, which had the least number of fighters. Bringing up the rear was Dan with the secondlargest number of fighters. This arrangement was based on sound military tactics. Generally, an opposing army either attacks head-on or goes around and attacks from the rear, assuming that those in the rear would offer the weakest opposition. This is of course what Amalek had done when it attacked the weakened stragglers. The two strongest groups, headed by Yehuda and Dan, protected the two most likely points of attack.
This also explains why the order of the listing of the tribes changes from chapter one to chapter two. In the first listing, Reuven and his accompanying tribes come first, as he was the firstborn, followed by Yehuda, Ephraim and Dan. However, when the Torah describes the movement of the nation, the military preparations become most important. Yehuda, based on his strength and numerical superiority, comes first. Dan is still mentioned last, not because he represents the less-important maidservants, but because he serves to protect the nation from an attack from the rear.