So Joshua made a covenant with the people that day, and set them a statute and an ordinance in Shechem.
25. So Joshua made a covenant, etc This passage demonstrates the end for which the meeting had been called, namely, to bind the people more completely and more solemnly to God, by the renewal of the covenant. Therefore, in this agreement, Joshua acted as if he had been appointed on the part of God to receive in his name the homage and obedience promised by the people.
Joshua compels them to choose not because serving God is optional, but because a reasoned, deliberate choice will bind their consciences far more securely than mere obligation. The will of man clings most firmly to what it has elected freely; thus he sets before them a genuine fork in the road and demands they take it knowingly.
AI summary
Commenting on Joshua 24:15-28
So Joshua made a covenant with the people that day,.... Proposing to them what was most eligible, and their duty to do, and they agreeing to it, this formally constituted a covenant, of which they selves were both parties and witnesses: and set statute and an ordinance in Shechem; either made this covenant to have the nature of a statute and ordinance binding upon them...