Moshe knows that he will not lead the people of Israel into the Promised Land. Hence he requests of Hashem to appoint a leader that will take his place and lead the people. Hashem answers his request and says: קַח־לְךָ אֶת־יְהוֹשֻׁעַ בִּן־נוּן, “…take to yourself Yehoshua the son of Nun…”. (Num. 27,18) Moshe was instructed to appoint Yehoshua to follow him in leading Bnei Israel.
There were numerous people who could have fulfilled this exalted position. Among them were the sons of Aharon and many of the leaders of the tribes. Yet he was instructed to pick Yehoshua. Why so?
Rashi quotes the Midrash (Sifri, Bamidbar, Pinchas, 140) that says: את שבדוק לך, “…one who has been proved by you…one whom you know well…”.
Yehoshua was picked because he was close to Moshe. A scholar could be very learned and know all the laws. Yet, this is not sufficient to deal with the needs of the people. A leader must know how to deal with people and how to interpret the law according to the situation at hand. That means, he must know how to apply the law to the circumstances and it is not enough to know the law theoretically.
Yehoshua was that kind of a person because he was constantly with Moshe and could detect how Moshe was going to react to all trying situations that confronted him. Yehoshua had the practical experience of applying the law. That is relevant today. A successful leader is one who can analyze a situation and understand exactly what law applies and how it is to be rendered.