The transition of leadership requires a firm foundation of authority. The people's declaration to Joshua establishes his absolute control, setting a severe penalty for any rebellion while simultaneously demanding strong and faithful leadership in return. To rebel means to intentionally provoke and act against the leader's directives [רש״י, מצודת ציון].
Disobedience takes two forms. It can be an active rebellion where a person does the exact opposite of what was ordered, or a passive failure to fulfill a given command [מלבי״ם, חומת אנך]. In either case, the punishment is death. This severe consequence applies even to the refusal of a minor directive. A person who defies the leader is judged as a traitor to the crown, meaning they do not require a standard legal trial to face execution [מלבי״ם, חומת אנך].
However, the duty to obey the leader is not completely blind. The authority comes with a strict limitation. If the leader orders the people to commit a sin and uproot a Commandment from the Torah, they must not listen to him, unless it is a strictly temporary emergency measure [רד״ק, רלב״ג, חומת אנך]. Additionally, for a command to carry the threat of the death penalty, it must be delivered verbally directly from the leader, rather than through a written message [חומת אנך].
Leadership is a reciprocal relationship. The people turn to Joshua and outline his own obligations. He must serve as a dedicated shepherd, guiding the nation with diligence and never abandoning them [רלב״ג]. At the same time, he must project governmental strength. He is expected to ensure his orders are carried out, punish those who rebel, and refuse to overlook offenses against his honor [מצודת דוד, ביאור שטיינזלץ]. Alongside these demands of public authority, he is called to strengthen himself personally by fulfilling God's Commandments and dedicating himself to the study of the Torah [רלב״ג, צאינה וראינה].