Now, here is how it went. First, Joshua sent out surveyors to divide the remainder of the land up into 7 sections. The land was divided (in this case) without any indication (yet) of who would get each section. Secondly, lots were cast (in other words, the divvying of the portions was "random"). Of course, we know that God is in charge of the executions of the statistics of probability, and there are truly no accidents in life (Proverbs 16:33). Each tribe received the area that God had purposed for them, but due to the way it was done, there was no way that accusations of favoritism could have come against Joshua (Proverbs 18:18).
Not surprisingly, Benjamin was the first to receive a portion. After all, Benjamin had been Jacob's baby. Again, ironically the land that Ben received "happened" to be between the 2 sections that had previously been assigned to Ephraim (Joseph's blessed son; blessed specifically by Jacob) and to Judah (the royal tribe of the coming Messiah). Benjamin was to become the tribe of the first king of Israel: Saul (1 Samuel 10:21), and would become inseparably attached to Judah (I Kings 12:23). Also, Jerusalem, the eventual capital of Israel, was nestled in a great location, surrounded by the people of the tribes of Judah and Benjamin.