“from going back and forth on the earth.” This meeting of spirit beings occurs in heaven. The “sons of God,” who came to present themselves before Yahweh were spirit beings that were directly created by God, in fact, some versions translate them as “angels” (cp. NIV), and the NLT translates the phrase as “members of the heavenly court.” That heaven is the location of this meeting can be ascertained because when Satan comes, along with other spirit beings, to present himself before Yahweh, Yahweh asks where he came from, and Satan said he came “from” the earth.
Although the fullness of Satan’s power and army of demons is not revealed in the Old Testament like it is in the New Testament, the power of Satan as the “god of this age” (2 Cor. 4:4), the “ruler of the power of the air” (Eph. 2:2), and the “ruler of this world” (John 12:31) can be clearly seen as he works his evil against Job. He marshals evil armies (Job 1:15, 17), causes destructive storms (Job 1:16, 19), and causes sickness and disease (Job 2:7). He does these things as a freewill being at war with God, and one day he and his work will be destroyed.
[For more on the “sons of God” being spirit beings who were created by God, see commentary on Gen. 6:2].