Joshua 24:13
And I have given you a land for which ye did not labour, and cities which ye built not, and ye dwell in them; of the vineyards and oliveyards which ye planted not do ye eat. And I have given you a land for which ye did not labour, and cities which ye built not, and ye dwell in them; of the vineyards and oliveyards which ye planted not do ye eat.
Joshua 24:13 belongs to Joshua's final work near the end of his life, when weighed down by age and about to lay his work upon the leaders of the nation he gathered the tribes for his last meeting before death to recount their history since they were called out as God's people and to renew their vows in his presence as their dying leader. He summoned the people to Shechem, and they gathered in obedience at Shechem for that solemn renewal. Shechem was full of sacred memory, recalling God's covenant with Abraham and with Jacob and Israel's own solemn vows on entering Canaan, with Mount Ebal and Mount Gerizim standing as silent witnesses of those vows.
The verse means that God gave Israel a land for which they had not labored, cities they had not built in which they now dwelt, and vineyards and olive groves they had not planted but from which they now ate, so that their settled possession and prosperity were God's gift and provision rather than the result of their own labor or strength. That land, those cities, vineyards, and oliveyards stood on every side as visible evidence of what God had done for them, displaying His goodness and mercy and recalling His mighty works and providence toward Israel. This rehearsal of past blessings and mercies was meant to strengthen faith by recalling what God had given, and to lead to gratitude for His providence and to humility over murmuring and disobedience. For that reason it gave the people reason to serve the Lord sincerely and truthfully and to reject idols.
The gift carries a warning to avoid idolatry and close ties with idolaters, including intermarriage, because these corrupt and lead to sin and ruin. For God is faithful both to fulfill His promises and to carry out His warnings, so that desolation would follow departure from Him, a warning to be applied personally. Just as Moses just before his death called the children of Israel together and rehearsed their past experience, trials, failures, and the warnings given them, so Joshua did the same. It sets the pattern to be followed today of rehearsing the instruction God has given His people by repeating and repeating what has been given to ministers, men in responsible positions, teachers, managers, and the different conferences, in order to hold confidence firm and defend the truth given after the passing of the time against Satan's special work to make of no effect the Testimonies from God.