“according to all that Yahweh spoke to Moses.” One of the purposes of the book of Joshua was to show that God kept His covenant promise to the patriarchs to give the land of Canaan to their descendants. God told Abraham that he and his descendants would get the land (Gen. 12:7; 13:15-17; 15:7, 18; 17:8). He told it to Isaac (Gen. 26:3). He told it to Jacob (Gen. 28:13; 35:12; 48:4). He told others as well (see commentary on Gen. 15:18). Not one of God’s promises to Israel failed (Josh. 21:45).
“Joshua gave it for an inheritance.” This is a wonderful example of the principle of author-agent as it was used in the Semitic languages. In many places the Bible says Yahweh gave the land to Israel, but here it says Joshua did it. Joshua was God’s agent. (Lev. 25:6; Deut. 1:8; Josh. 1:6, 11, 13; 5:6). In a similar way, Jesus is said to do some things that God is also said to do. Both Joshua and Jesus were agents of God and did His work (cp. John 5:30).
“And the land had rest from war.” From God’s perspective, “the land” had rest from war. The phrase, “and the land had rest from war” is also in Joshua 14:15, when Caleb received Hebron in Judah as his inheritance. War does not just disrupt the lives of people, the land and everything on it is hurt by war (cp. Isa. 14:7). Nevertheless, because the enemies of God do not willingly submit to Him, it sometimes occurs that war is necessary to bring about the peace that God wants. Jesus himself will fight and win the Battle of Armageddon (cp. Isa. 63:1-6; Rev. 19:11-21).